From 34d62889457f92ff565ea793cd8dc2e2253f8f8b Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Wed, 20 Sep 2023 04:17:30 -0500 Subject: [PATCH] feat: bring back sqlness and integration tests (#2448) * enable integration test Signed-off-by: Ruihang Xia * update sqlness result Signed-off-by: Ruihang Xia * disable sqlness region failover Signed-off-by: Ruihang Xia * enable sqlness in CI Signed-off-by: Ruihang Xia * sort unstable result Signed-off-by: Ruihang Xia * set require_lease_before_startup to true Signed-off-by: Ruihang Xia * fix: fix inconsistent cache * replace windows path chars Signed-off-by: Ruihang Xia * ignore some integration cases in windows Signed-off-by: Ruihang Xia * Revert "ignore some integration cases in windows" This reverts commit 122478b7c1bb8c8af22ffbf9bd7ca738acfe23e0. * disable windows for now Signed-off-by: Ruihang Xia * fix: fix close region bug in RegionHeartbeatResponseHandler * disable failover tests --------- Signed-off-by: Ruihang Xia Co-authored-by: WenyXu --- .github/workflows/develop.yml | 123 ++-- Cargo.lock | 563 ++++++++++++++++-- Cargo.toml | 3 +- src/common/meta/src/ddl/drop_table.rs | 5 +- src/datanode/src/heartbeat/handler.rs | 19 +- src/operator/src/statement/ddl.rs | 19 +- tests-integration/Cargo.toml | 1 - tests-integration/src/test_util.rs | 1 + tests-integration/src/tests/instance_test.rs | 53 +- tests-integration/src/tests/test_util.rs | 2 +- tests-integration/tests/http.rs | 7 +- tests-integration/tests/main.rs | 6 +- tests-integration/tests/sql.rs | 12 +- .../order/order_variable_size_payload.result | 27 +- .../order/order_variable_size_payload.sql | 1 + tests/conf/datanode-test.toml.template | 1 + tests/conf/standalone-test.toml.template | 1 + tests/runner/src/env.rs | 2 + 18 files changed, 655 insertions(+), 191 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 504676423a0e..a409e3a0cb09 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -74,33 +74,33 @@ jobs: - name: Run taplo run: taplo format --check - # sqlness: - # name: Sqlness Test - # if: github.event.pull_request.draft == false - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [ ubuntu-latest-8-cores, windows-latest-8-cores ] - # timeout-minutes: 60 - # steps: - # - uses: actions/checkout@v3 - # - uses: arduino/setup-protoc@v1 - # with: - # repo-token: ${{ secrets.GITHUB_TOKEN }} - # - uses: dtolnay/rust-toolchain@master - # with: - # toolchain: ${{ env.RUST_TOOLCHAIN }} - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # - name: Run sqlness - # run: cargo sqlness - # - name: Upload sqlness logs - # if: always() - # uses: actions/upload-artifact@v3 - # with: - # name: sqlness-logs - # path: ${{ runner.temp }}/greptime-*.log - # retention-days: 3 + sqlness: + name: Sqlness Test + if: github.event.pull_request.draft == false + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest-8-cores, windows-latest-8-cores ] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v3 + - uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Run sqlness + run: cargo sqlness + - name: Upload sqlness logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: sqlness-logs + path: ${{ runner.temp }}/greptime-*.log + retention-days: 3 fmt: name: Rustfmt @@ -194,37 +194,38 @@ jobs: runs-on: windows-latest-8-cores timeout-minutes: 60 steps: - - run: git config --global core.autocrlf false - - uses: actions/checkout@v3 - - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - components: llvm-tools-preview - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Install Cargo Nextest - uses: taiki-e/install-action@nextest - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install PyArrow Package - run: pip install pyarrow - - name: Install WSL distribution - uses: Vampire/setup-wsl@v2 - with: - distribution: Ubuntu-22.04 - - name: Running tests - run: cargo nextest run -F pyo3_backend,dashboard - env: - RUST_BACKTRACE: 1 - CARGO_INCREMENTAL: 0 - GT_S3_BUCKET: ${{ secrets.S3_BUCKET }} - GT_S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} - GT_S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} - GT_S3_REGION: ${{ secrets.S3_REGION }} - UNITTEST_LOG_DIR: "__unittest_logs" + - run: 'echo "temporary disabled"' + # - run: git config --global core.autocrlf false + # - uses: actions/checkout@v3 + # - uses: arduino/setup-protoc@v1 + # with: + # repo-token: ${{ secrets.GITHUB_TOKEN }} + # - name: Install Rust toolchain + # uses: dtolnay/rust-toolchain@master + # with: + # toolchain: ${{ env.RUST_TOOLCHAIN }} + # components: llvm-tools-preview + # - name: Rust Cache + # uses: Swatinem/rust-cache@v2 + # - name: Install Cargo Nextest + # uses: taiki-e/install-action@nextest + # - name: Install Python + # uses: actions/setup-python@v4 + # with: + # python-version: '3.10' + # - name: Install PyArrow Package + # run: pip install pyarrow + # - name: Install WSL distribution + # uses: Vampire/setup-wsl@v2 + # with: + # distribution: Ubuntu-22.04 + # - name: Running tests + # run: cargo nextest run -F pyo3_backend,dashboard + # env: + # RUST_BACKTRACE: 1 + # CARGO_INCREMENTAL: 0 + # GT_S3_BUCKET: ${{ secrets.S3_BUCKET }} + # GT_S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} + # GT_S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + # GT_S3_REGION: ${{ secrets.S3_REGION }} + # UNITTEST_LOG_DIR: "__unittest_logs" diff --git a/Cargo.lock b/Cargo.lock index 4e77e0405217..8af66ef41aa7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -651,6 +651,15 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "atoi" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +dependencies = [ + "num-traits", +] + [[package]] name = "atomic" version = "0.5.3" @@ -1259,7 +1268,7 @@ dependencies = [ "metrics", "moka 0.11.3", "object-store", - "parking_lot", + "parking_lot 0.12.1", "partition", "regex", "serde", @@ -1536,7 +1545,7 @@ dependencies = [ "enum_dispatch", "futures-util", "moka 0.9.9", - "parking_lot", + "parking_lot 0.12.1", "prost", "rand", "session", @@ -1973,7 +1982,7 @@ dependencies = [ "once_cell", "opentelemetry 0.17.0", "opentelemetry-jaeger", - "parking_lot", + "parking_lot 0.12.1", "rand", "rs-snowflake", "serde", @@ -2094,6 +2103,12 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + [[package]] name = "const-oid" version = "0.9.5" @@ -2162,6 +2177,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" + [[package]] name = "crc32fast" version = "1.3.2" @@ -2318,6 +2348,16 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array", + "subtle", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -2429,7 +2469,7 @@ dependencies = [ "hashbrown 0.14.0", "lock_api", "once_cell", - "parking_lot_core", + "parking_lot_core 0.9.8", ] [[package]] @@ -2464,7 +2504,7 @@ dependencies = [ "log", "num_cpus", "object_store", - "parking_lot", + "parking_lot 0.12.1", "parquet", "percent-encoding", "pin-project-lite", @@ -2505,7 +2545,7 @@ dependencies = [ "hashbrown 0.14.0", "log", "object_store", - "parking_lot", + "parking_lot 0.12.1", "rand", "tempfile", "url", @@ -2720,14 +2760,25 @@ dependencies = [ "uuid", ] +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid 0.7.1", + "crypto-bigint", + "pem-rfc7468 0.3.1", +] + [[package]] name = "der" version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "const-oid", - "pem-rfc7468", + "const-oid 0.9.5", + "pem-rfc7468 0.7.0", "zeroize", ] @@ -2826,7 +2877,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", - "const-oid", + "const-oid 0.9.5", "crypto-common", "subtle", ] @@ -2905,6 +2956,18 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "dunce" version = "1.0.4" @@ -3421,6 +3484,17 @@ dependencies = [ "futures-util", ] +[[package]] +name = "futures-intrusive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot 0.11.2", +] + [[package]] name = "futures-io" version = "0.3.28" @@ -3465,6 +3539,12 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.28" @@ -3818,7 +3898,7 @@ checksum = "e4e55e40dfd694884f0eb78796c5bddcf2f8b295dace47039099dd7e76534973" dependencies = [ "gix-hash 0.10.4", "hashbrown 0.13.2", - "parking_lot", + "parking_lot 0.12.1", ] [[package]] @@ -3897,7 +3977,7 @@ dependencies = [ "gix-pack", "gix-path", "gix-quote", - "parking_lot", + "parking_lot 0.12.1", "tempfile", "thiserror", ] @@ -3919,7 +3999,7 @@ dependencies = [ "gix-tempfile", "gix-traverse", "memmap2", - "parking_lot", + "parking_lot 0.12.1", "smallvec", "thiserror", ] @@ -3943,7 +4023,7 @@ dependencies = [ "gix-command", "gix-config-value", "nix 0.26.4", - "parking_lot", + "parking_lot 0.12.1", "thiserror", ] @@ -4027,7 +4107,7 @@ dependencies = [ "gix-fs", "libc", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "signal-hook", "signal-hook-registry", "tempfile", @@ -4180,6 +4260,15 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.0", +] + [[package]] name = "hdrhistogram" version = "7.5.2" @@ -4223,6 +4312,9 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "hermit-abi" @@ -4251,6 +4343,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" version = "0.12.1" @@ -4369,9 +4470,9 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls", + "rustls 0.21.7", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -5253,7 +5354,7 @@ dependencies = [ "lazy_static", "metrics", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "prost", "rand", "regex", @@ -5284,7 +5385,7 @@ source = "git+https://github.com/GreptimeTeam/greptime-meter.git?rev=abbd357c1e1 dependencies = [ "anymap", "once_cell", - "parking_lot", + "parking_lot 0.12.1", ] [[package]] @@ -5315,7 +5416,7 @@ dependencies = [ "indexmap 1.9.3", "metrics", "metrics-util", - "parking_lot", + "parking_lot 0.12.1", "portable-atomic 0.3.20", "quanta 0.10.1", "thiserror", @@ -5361,7 +5462,7 @@ dependencies = [ "metrics", "num_cpus", "ordered-float 2.10.0", - "parking_lot", + "parking_lot 0.12.1", "portable-atomic 0.3.20", "quanta 0.10.1", "radix_trie", @@ -5479,7 +5580,7 @@ dependencies = [ "futures-util", "num_cpus", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "quanta 0.11.1", "rustc_version", "scheduled-thread-pool", @@ -5504,7 +5605,7 @@ dependencies = [ "crossbeam-utils", "futures-util", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "quanta 0.11.1", "rustc_version", "scheduled-thread-pool", @@ -5569,19 +5670,19 @@ dependencies = [ "percent-encoding", "pin-project", "priority-queue", - "rustls", + "rustls 0.21.7", "rustls-pemfile", "serde", "serde_json", "socket2 0.5.3", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "twox-hash", "url", "webpki", - "webpki-roots", + "webpki-roots 0.23.1", ] [[package]] @@ -5928,7 +6029,7 @@ dependencies = [ "futures", "humantime", "itertools 0.10.5", - "parking_lot", + "parking_lot 0.12.1", "percent-encoding", "snafu", "tokio", @@ -5969,7 +6070,7 @@ dependencies = [ "md-5", "metrics", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "percent-encoding", "pin-project", "quick-xml 0.29.0", @@ -6007,7 +6108,7 @@ dependencies = [ "nom", "pin-project-lite", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -6296,6 +6397,17 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -6303,7 +6415,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.8", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -6426,6 +6552,15 @@ dependencies = [ "serde", ] +[[package]] +name = "pem-rfc7468" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30" +dependencies = [ + "base64ct", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -6519,7 +6654,7 @@ dependencies = [ "thiserror", "time 0.3.28", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "x509-certificate", ] @@ -6604,15 +6739,37 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320" +dependencies = [ + "der 0.5.1", + "pkcs8 0.8.0", + "zeroize", +] + [[package]] name = "pkcs1" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der", - "pkcs8", - "spki", + "der 0.7.8", + "pkcs8 0.10.2", + "spki 0.7.2", +] + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der 0.5.1", + "spki 0.5.4", + "zeroize", ] [[package]] @@ -6621,8 +6778,8 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.8", + "spki 0.7.2", ] [[package]] @@ -6745,7 +6902,7 @@ dependencies = [ "log", "nix 0.26.4", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "prost", "prost-build", "prost-derive", @@ -6896,7 +7053,7 @@ dependencies = [ "fnv", "lazy_static", "memchr", - "parking_lot", + "parking_lot 0.12.1", "protobuf", "thiserror", ] @@ -7092,7 +7249,7 @@ dependencies = [ "indoc", "libc", "memoffset 0.9.0", - "parking_lot", + "parking_lot 0.12.1", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", @@ -7303,7 +7460,7 @@ dependencies = [ "nix 0.26.4", "num-derive", "num-traits", - "parking_lot", + "parking_lot 0.12.1", "prometheus", "prometheus-static-metric", "protobuf", @@ -7519,7 +7676,7 @@ dependencies = [ "quick-xml 0.29.0", "rand", "reqwest", - "rsa", + "rsa 0.9.2", "rust-ini 0.19.0", "serde", "serde_json", @@ -7552,14 +7709,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.7", "rustls-native-certs", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "tower-service", "url", @@ -7709,6 +7866,26 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e60ef3b82994702bbe4e134d98aadca4b49ed04440148985678d415c68127666" +[[package]] +name = "rsa" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" +dependencies = [ + "byteorder", + "digest", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1 0.3.3", + "pkcs8 0.8.0", + "rand_core", + "smallvec", + "subtle", + "zeroize", +] + [[package]] name = "rsa" version = "0.9.2" @@ -7716,21 +7893,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" dependencies = [ "byteorder", - "const-oid", + "const-oid 0.9.5", "digest", "num-bigint-dig", "num-integer", "num-iter", "num-traits", - "pkcs1", - "pkcs8", + "pkcs1 0.7.5", + "pkcs8 0.10.2", "rand_core", "signature", - "spki", + "spki 0.7.2", "subtle", "zeroize", ] +[[package]] +name = "rstest" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de1bb486a691878cd320c2f0d319ba91eeaa2e894066d8b5f8f117c000e9d962" +dependencies = [ + "futures", + "futures-timer", + "rstest_macros", + "rustc_version", +] + +[[package]] +name = "rstest_macros" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290ca1a1c8ca7edb7c3283bd44dc35dd54fdec6253a3912e201ba1072018fca8" +dependencies = [ + "cfg-if 1.0.0", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", + "unicode-ident", +] + +[[package]] +name = "rstest_reuse" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45f80dcc84beab3a327bbe161f77db25f336a1452428176787c8c79ac79d7073" +dependencies = [ + "quote", + "rand", + "rustc_version", + "syn 1.0.109", +] + [[package]] name = "rust-embed" version = "6.8.1" @@ -7863,6 +8078,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + [[package]] name = "rustls" version = "0.21.7" @@ -8098,7 +8325,7 @@ dependencies = [ "num_enum", "once_cell", "page_size", - "parking_lot", + "parking_lot 0.12.1", "paste", "puruspe", "rand", @@ -8164,7 +8391,7 @@ dependencies = [ "num_enum", "once_cell", "optional", - "parking_lot", + "parking_lot 0.12.1", "paste", "rand", "result-like", @@ -8349,7 +8576,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19" dependencies = [ - "parking_lot", + "parking_lot 0.12.1", ] [[package]] @@ -8717,7 +8944,7 @@ dependencies = [ "openmetrics-parser", "opensrv-mysql", "opentelemetry-proto", - "parking_lot", + "parking_lot 0.12.1", "pgwire", "pin-project", "postgres-types", @@ -8728,7 +8955,7 @@ dependencies = [ "rand", "regex", "rust-embed", - "rustls", + "rustls 0.21.7", "rustls-pemfile", "schemars", "script", @@ -8746,7 +8973,7 @@ dependencies = [ "tokio", "tokio-postgres", "tokio-postgres-rustls", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-stream", "tokio-test", "tonic 0.9.2", @@ -9012,6 +9239,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der 0.5.1", +] + [[package]] name = "spki" version = "0.7.2" @@ -9019,7 +9256,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der", + "der 0.7.8", ] [[package]] @@ -9046,6 +9283,17 @@ dependencies = [ "table", ] +[[package]] +name = "sqlformat" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" +dependencies = [ + "itertools 0.11.0", + "nom", + "unicode_categories", +] + [[package]] name = "sqlness" version = "0.5.0" @@ -9123,6 +9371,104 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "sqlx" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8de3b03a925878ed54a954f621e64bf55a3c1bd29652d0d1a17830405350188" +dependencies = [ + "sqlx-core", + "sqlx-macros", +] + +[[package]] +name = "sqlx-core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" +dependencies = [ + "ahash 0.7.6", + "atoi", + "base64 0.13.1", + "bitflags 1.3.2", + "byteorder", + "bytes", + "chrono", + "crc", + "crossbeam-queue", + "digest", + "dirs", + "dotenvy", + "either", + "event-listener", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-util", + "generic-array", + "hashlink", + "hex", + "hkdf", + "hmac", + "indexmap 1.9.3", + "itoa", + "libc", + "log", + "md-5", + "memchr", + "num-bigint", + "once_cell", + "paste", + "percent-encoding", + "rand", + "rsa 0.6.1", + "rustls 0.20.9", + "rustls-pemfile", + "serde", + "serde_json", + "sha1", + "sha2", + "smallvec", + "sqlformat", + "sqlx-rt", + "stringprep", + "thiserror", + "tokio-stream", + "url", + "webpki-roots 0.22.6", + "whoami", +] + +[[package]] +name = "sqlx-macros" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9966e64ae989e7e575b19d7265cb79d7fc3cbbdf179835cb0d716f294c2049c9" +dependencies = [ + "dotenvy", + "either", + "heck", + "once_cell", + "proc-macro2", + "quote", + "sha2", + "sqlx-core", + "sqlx-rt", + "syn 1.0.109", + "url", +] + +[[package]] +name = "sqlx-rt" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" +dependencies = [ + "once_cell", + "tokio", + "tokio-rustls 0.23.4", +] + [[package]] name = "sre-engine" version = "0.4.1" @@ -9280,7 +9626,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "phf_shared 0.10.0", "precomputed-hash", ] @@ -9575,7 +9921,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9547444bfe52cbd79515c6c8087d8ae6ca8d64d2d31a27746320f5cb81d1a15c" dependencies = [ - "parking_lot", + "parking_lot 0.12.1", ] [[package]] @@ -9620,6 +9966,71 @@ dependencies = [ "libc", ] +[[package]] +name = "tests-integration" +version = "0.4.0-nightly" +dependencies = [ + "api", + "async-trait", + "auth", + "axum", + "axum-test-helper", + "catalog", + "chrono", + "client", + "common-base", + "common-catalog", + "common-config", + "common-error", + "common-grpc", + "common-meta", + "common-procedure", + "common-query", + "common-recordbatch", + "common-runtime", + "common-telemetry", + "common-test-util", + "datafusion", + "datafusion-expr", + "datanode", + "datatypes", + "dotenv", + "frontend", + "futures", + "itertools 0.10.5", + "meta-client", + "meta-srv", + "object-store", + "once_cell", + "opentelemetry-proto", + "operator", + "partition", + "paste", + "prost", + "query", + "rand", + "rstest", + "rstest_reuse", + "script", + "secrecy", + "serde", + "serde_json", + "servers", + "session", + "snafu", + "sql", + "sqlx", + "store-api", + "substrait 0.4.0-nightly", + "table", + "tempfile", + "tokio", + "tokio-postgres", + "tonic 0.9.2", + "tower", + "uuid", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -9837,7 +10248,7 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2 0.5.3", @@ -9880,7 +10291,7 @@ dependencies = [ "futures-channel", "futures-util", "log", - "parking_lot", + "parking_lot 0.12.1", "percent-encoding", "phf", "pin-project-lite", @@ -9901,10 +10312,21 @@ checksum = "dd5831152cb0d3f79ef5523b357319ba154795d64c7078b2daa95a803b54057f" dependencies = [ "futures", "ring", - "rustls", + "rustls 0.21.7", "tokio", "tokio-postgres", - "tokio-rustls", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.9", + "tokio", + "webpki", ] [[package]] @@ -9913,7 +10335,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.7", "tokio", ] @@ -10054,7 +10476,7 @@ dependencies = [ "prost", "rustls-pemfile", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-stream", "tower", "tower-layer", @@ -10625,6 +11047,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + [[package]] name = "unicode_names2" version = "0.6.0" @@ -10890,6 +11318,15 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + [[package]] name = "webpki-roots" version = "0.23.1" @@ -11212,12 +11649,12 @@ dependencies = [ "bcder", "bytes", "chrono", - "der", + "der 0.7.8", "hex", "pem 2.0.1", "ring", "signature", - "spki", + "spki 0.7.2", "thiserror", ] diff --git a/Cargo.toml b/Cargo.toml index 9030541af44c..8513ed610edd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,8 +48,7 @@ members = [ "src/storage", "src/store-api", "src/table", - # TODO: add this back once the region server is available - # "tests-integration", + "tests-integration", "tests/runner", ] resolver = "2" diff --git a/src/common/meta/src/ddl/drop_table.rs b/src/common/meta/src/ddl/drop_table.rs index 929416673024..f8c11324fa8e 100644 --- a/src/common/meta/src/ddl/drop_table.rs +++ b/src/common/meta/src/ddl/drop_table.rs @@ -121,12 +121,13 @@ impl DropTableProcedure { }; let cache_invalidator = &self.context.cache_invalidator; + cache_invalidator - .invalidate_table_id(&ctx, self.data.table_id()) + .invalidate_table_name(&ctx, self.data.table_ref().into()) .await?; cache_invalidator - .invalidate_table_name(&ctx, self.data.table_ref().into()) + .invalidate_table_id(&ctx, self.data.table_id()) .await?; self.data.state = DropTableState::DatanodeDropRegions; diff --git a/src/datanode/src/heartbeat/handler.rs b/src/datanode/src/heartbeat/handler.rs index dac1efca90db..026245259cec 100644 --- a/src/datanode/src/heartbeat/handler.rs +++ b/src/datanode/src/heartbeat/handler.rs @@ -15,6 +15,8 @@ use std::collections::HashMap; use async_trait::async_trait; +use common_error::ext::ErrorExt; +use common_error::status_code::StatusCode; use common_meta::error::{InvalidHeartbeatResponseSnafu, Result as MetaResult}; use common_meta::heartbeat::handler::{ HandleControl, HeartbeatResponseHandler, HeartbeatResponseHandlerContext, @@ -92,16 +94,23 @@ impl RegionHeartbeatResponseHandler { fn fill_reply(mut template: InstructionReply, result: Result) -> InstructionReply { let success = result.is_ok(); - let error = result.map_err(|e| e.to_string()).err(); + let error = result.as_ref().map_err(|e| e.to_string()).err(); match &mut template { InstructionReply::OpenRegion(reply) => { reply.result = success; reply.error = error; } - InstructionReply::CloseRegion(reply) => { - reply.result = success; - reply.error = error; - } + InstructionReply::CloseRegion(reply) => match result { + Err(e) => { + if e.status_code() == StatusCode::RegionNotFound { + reply.result = true; + } + } + _ => { + reply.result = success; + reply.error = error; + } + }, InstructionReply::InvalidateTableCache(reply) => { reply.result = success; reply.error = error; diff --git a/src/operator/src/statement/ddl.rs b/src/operator/src/statement/ddl.rs index 768f03a35878..f2752eba6b46 100644 --- a/src/operator/src/statement/ddl.rs +++ b/src/operator/src/statement/ddl.rs @@ -123,12 +123,6 @@ impl StatementExecutor { let table = DistTable::table(table_info); - // Invalidates local cache ASAP. - self.cache_invalidator - .invalidate_table_id(&Context::default(), table_id) - .await - .context(error::InvalidateTableCacheSnafu)?; - Ok(table) } @@ -154,6 +148,11 @@ impl StatementExecutor { .await .context(error::InvalidateTableCacheSnafu)?; + self.cache_invalidator + .invalidate_table_name(&Context::default(), table_name.clone()) + .await + .context(error::InvalidateTableCacheSnafu)?; + Ok(Output::AffectedRows(1)) } @@ -262,6 +261,14 @@ impl StatementExecutor { .await .context(error::InvalidateTableCacheSnafu)?; + self.cache_invalidator + .invalidate_table_name( + &Context::default(), + TableName::new(catalog_name, schema_name, table_name), + ) + .await + .context(error::InvalidateTableCacheSnafu)?; + Ok(Output::AffectedRows(0)) } diff --git a/tests-integration/Cargo.toml b/tests-integration/Cargo.toml index d58daccca2e0..f75420d6056f 100644 --- a/tests-integration/Cargo.toml +++ b/tests-integration/Cargo.toml @@ -35,7 +35,6 @@ frontend = { workspace = true, features = ["testing"] } futures.workspace = true meta-client = { workspace = true } meta-srv = { workspace = true, features = ["mock"] } -mito = { workspace = true, features = ["test"] } object-store = { workspace = true } once_cell.workspace = true operator = { workspace = true } diff --git a/tests-integration/src/test_util.rs b/tests-integration/src/test_util.rs index 1dd199b18994..a6c0cf72fb65 100644 --- a/tests-integration/src/test_util.rs +++ b/tests-integration/src/test_util.rs @@ -292,6 +292,7 @@ pub fn create_tmp_dir_and_datanode_opts( pub(crate) fn create_datanode_opts(store: ObjectStoreConfig, home_dir: String) -> DatanodeOptions { DatanodeOptions { node_id: Some(0), + require_lease_before_startup: true, storage: StorageConfig { data_home: home_dir, store, diff --git a/tests-integration/src/tests/instance_test.rs b/tests-integration/src/tests/instance_test.rs index b83c0fe55a3a..54c2c3c54359 100644 --- a/tests-integration/src/tests/instance_test.rs +++ b/tests-integration/src/tests/instance_test.rs @@ -476,7 +476,6 @@ async fn test_execute_show_databases_tables(instance: Arc) { | Tables | +---------+ | numbers | -| scripts | +---------+\ "; let output = execute_sql(&instance, "show tables").await; @@ -494,7 +493,6 @@ async fn test_execute_show_databases_tables(instance: Arc) { +---------+ | demo | | numbers | -| scripts | +---------+\ "; check_unordered_output_stream(output, expected).await; @@ -577,7 +575,12 @@ async fn test_execute_external_create_infer_format(instance: Arc) { +---------------+--------------------+------------+-----------------+----------+-------------+ | greptime | information_schema | columns | LOCAL TEMPORARY | 4 | | | greptime | public | numbers | LOCAL TEMPORARY | 2 | test_engine | -| greptime | public | scripts | BASE TABLE | 1024 | mito | | greptime | information_schema | tables | LOCAL TEMPORARY | 3 | | +---------------+--------------------+------------+-----------------+----------+-------------+"; @@ -1754,7 +1756,7 @@ async fn test_information_schema_dot_tables(instance: Arc) { +-----------------+--------------------+---------------+-----------------+----------+--------+ | table_catalog | table_schema | table_name | table_type | table_id | engine | +-----------------+--------------------+---------------+-----------------+----------+--------+ -| another_catalog | another_schema | another_table | BASE TABLE | 1025 | mito | +| another_catalog | another_schema | another_table | BASE TABLE | 1024 | mito | | another_catalog | information_schema | columns | LOCAL TEMPORARY | 4 | | | another_catalog | information_schema | tables | LOCAL TEMPORARY | 3 | | +-----------------+--------------------+---------------+-----------------+----------+--------+"; @@ -1776,30 +1778,23 @@ async fn test_information_schema_dot_columns(instance: Arc) { let output = execute_sql(&instance, sql).await; let expected = "\ -+---------------+--------------------+------------+---------------+----------------------+---------------+ -| table_catalog | table_schema | table_name | column_name | data_type | semantic_type | -+---------------+--------------------+------------+---------------+----------------------+---------------+ -| greptime | information_schema | columns | table_catalog | String | FIELD | -| greptime | information_schema | columns | table_schema | String | FIELD | -| greptime | information_schema | columns | table_name | String | FIELD | -| greptime | information_schema | columns | column_name | String | FIELD | -| greptime | information_schema | columns | data_type | String | FIELD | -| greptime | information_schema | columns | semantic_type | String | FIELD | -| greptime | public | numbers | number | UInt32 | TAG | -| greptime | public | scripts | schema | String | TAG | -| greptime | public | scripts | name | String | TAG | -| greptime | public | scripts | script | String | FIELD | -| greptime | public | scripts | engine | String | FIELD | -| greptime | public | scripts | timestamp | TimestampMillisecond | TIMESTAMP | -| greptime | public | scripts | gmt_created | TimestampMillisecond | FIELD | -| greptime | public | scripts | gmt_modified | TimestampMillisecond | FIELD | -| greptime | information_schema | tables | table_catalog | String | FIELD | -| greptime | information_schema | tables | table_schema | String | FIELD | -| greptime | information_schema | tables | table_name | String | FIELD | -| greptime | information_schema | tables | table_type | String | FIELD | -| greptime | information_schema | tables | table_id | UInt32 | FIELD | -| greptime | information_schema | tables | engine | String | FIELD | -+---------------+--------------------+------------+---------------+----------------------+---------------+"; ++---------------+--------------------+------------+---------------+-----------+---------------+ +| table_catalog | table_schema | table_name | column_name | data_type | semantic_type | ++---------------+--------------------+------------+---------------+-----------+---------------+ +| greptime | information_schema | columns | table_catalog | String | FIELD | +| greptime | information_schema | columns | table_schema | String | FIELD | +| greptime | information_schema | columns | table_name | String | FIELD | +| greptime | information_schema | columns | column_name | String | FIELD | +| greptime | information_schema | columns | data_type | String | FIELD | +| greptime | information_schema | columns | semantic_type | String | FIELD | +| greptime | public | numbers | number | UInt32 | TAG | +| greptime | information_schema | tables | table_catalog | String | FIELD | +| greptime | information_schema | tables | table_schema | String | FIELD | +| greptime | information_schema | tables | table_name | String | FIELD | +| greptime | information_schema | tables | table_type | String | FIELD | +| greptime | information_schema | tables | table_id | UInt32 | FIELD | +| greptime | information_schema | tables | engine | String | FIELD | ++---------------+--------------------+------------+---------------+-----------+---------------+"; check_output_stream(output, expected).await; diff --git a/tests-integration/src/tests/test_util.rs b/tests-integration/src/tests/test_util.rs index 40736f25385e..fe814b5155be 100644 --- a/tests-integration/src/tests/test_util.rs +++ b/tests-integration/src/tests/test_util.rs @@ -117,7 +117,7 @@ pub fn find_testing_resource(path: &str) -> String { // We need unix style path even in the Windows, because the path is used in object-store, must // be delimited with '/'. Inside the object-store, it will be converted to file system needed // path in the end. - let p = p.replace('\\', "/"); + let p = p.replace(':', "").replace('\\', "/"); // Prepend a '/' to indicate it's a file system path when parsed as object-store url in Windows. format!("/{p}") diff --git a/tests-integration/tests/http.rs b/tests-integration/tests/http.rs index e5b40c026bb1..94cea9e0bf6a 100644 --- a/tests-integration/tests/http.rs +++ b/tests-integration/tests/http.rs @@ -606,7 +606,7 @@ pub async fn test_config_api(store_type: StorageType) { let expected_toml_str = format!( r#"mode = "standalone" node_id = 0 -coordination = false +require_lease_before_startup = true rpc_addr = "127.0.0.1:3001" rpc_runtime_size = 8 enable_telemetry = true @@ -689,7 +689,10 @@ fn drop_lines_with_inconsistent_results(input: String) -> String { && !line.trim().starts_with("scope =") }) .collect::>() - .join("\n") + .join( + " +", + ) } #[cfg(feature = "dashboard")] diff --git a/tests-integration/tests/main.rs b/tests-integration/tests/main.rs index eec30447a35c..8b1e064579c8 100644 --- a/tests-integration/tests/main.rs +++ b/tests-integration/tests/main.rs @@ -18,10 +18,10 @@ mod grpc; mod http; #[macro_use] mod sql; -#[macro_use] -mod region_failover; +// #[macro_use] +// mod region_failover; grpc_tests!(File, S3, S3WithCache, Oss, Azblob, Gcs); http_tests!(File, S3, S3WithCache, Oss, Azblob, Gcs); -region_failover_tests!(File, S3, S3WithCache, Oss, Azblob); +// region_failover_tests!(File, S3, S3WithCache, Oss, Azblob); sql_tests!(File); diff --git a/tests-integration/tests/sql.rs b/tests-integration/tests/sql.rs index 8d4b83a1c1fd..a8efea7da026 100644 --- a/tests-integration/tests/sql.rs +++ b/tests-integration/tests/sql.rs @@ -54,10 +54,13 @@ macro_rules! sql_tests { $service, test_mysql_auth, - test_mysql_crud, + // ignore: https://github.com/GreptimeTeam/greptimedb/issues/2445 + // test_mysql_crud, test_postgres_auth, - test_postgres_crud, - test_postgres_parameter_inference, + // ignore: https://github.com/GreptimeTeam/greptimedb/issues/2445 + // test_postgres_crud, + // ignore: https://github.com/GreptimeTeam/greptimedb/issues/2445 + // test_postgres_parameter_inference, ); )* }; @@ -120,6 +123,7 @@ pub async fn test_mysql_auth(store_type: StorageType) { guard.remove_all().await; } +#[allow(dead_code)] pub async fn test_mysql_crud(store_type: StorageType) { common_telemetry::init_default_ut_logging(); @@ -266,6 +270,7 @@ pub async fn test_postgres_auth(store_type: StorageType) { guard.remove_all().await; } +#[allow(dead_code)] pub async fn test_postgres_crud(store_type: StorageType) { let (addr, mut guard, fe_pg_server) = setup_pg_server(store_type, "sql_crud").await; @@ -342,6 +347,7 @@ pub async fn test_postgres_crud(store_type: StorageType) { guard.remove_all().await; } +#[allow(dead_code)] pub async fn test_postgres_parameter_inference(store_type: StorageType) { let (addr, mut guard, fe_pg_server) = setup_pg_server(store_type, "sql_inference").await; diff --git a/tests/cases/standalone/common/order/order_variable_size_payload.result b/tests/cases/standalone/common/order/order_variable_size_payload.result index 5565d6e03ea9..3ca0af9af42c 100644 --- a/tests/cases/standalone/common/order/order_variable_size_payload.result +++ b/tests/cases/standalone/common/order/order_variable_size_payload.result @@ -6,19 +6,20 @@ insert into t0 values ('a', 1), (NULL,2), (NULL, 3), (NULL, 4), (NULL, 5), (NULL Affected Rows: 7 +-- SQLNESS SORT_RESULT 2 2 SELECT * FROM t0 ORDER BY t0.c0 DESC; -+----+-------------------------+ -| c0 | t | -+----+-------------------------+ -| | 1970-01-01T00:00:00.007 | -| | 1970-01-01T00:00:00.006 | -| | 1970-01-01T00:00:00.005 | -| | 1970-01-01T00:00:00.004 | -| | 1970-01-01T00:00:00.003 | -| | 1970-01-01T00:00:00.002 | -| a | 1970-01-01T00:00:00.001 | -+----+-------------------------+ ++------+-------------------------+ +| c0 | t | ++------+-------------------------+ +| null | 1970-01-01T00:00:00.002 | +| null | 1970-01-01T00:00:00.003 | +| null | 1970-01-01T00:00:00.004 | +| null | 1970-01-01T00:00:00.005 | +| null | 1970-01-01T00:00:00.006 | +| null | 1970-01-01T00:00:00.007 | +| a | 1970-01-01T00:00:00.001 | ++------+-------------------------+ CREATE TABLE test0 (job VARCHAR, name VARCHAR, t TIMESTAMP TIME INDEX); @@ -74,7 +75,7 @@ SELECT * FROM test1 ORDER BY s; | 3555555555552 | 1970-01-01T00:00:00.003 | | 3555555555553 | 1970-01-01T00:00:00.007 | | 355555555556 | 1970-01-01T00:00:00.005 | -| | 1970-01-01T00:00:00.002 | +| null | 1970-01-01T00:00:00.002 | +---------------+-------------------------+ CREATE TABLE test4 (i INT, j INT, t TIMESTAMP TIME INDEX); @@ -341,7 +342,7 @@ select i, split_part(s, 'b', 1) from test8 order by i; | i | split_part(test8.s,Utf8("b"),Int64(1)) | +---+----------------------------------------+ | 1 | cc | -| 2 | | +| 2 | null | | 3 | a | | | d | +---+----------------------------------------+ diff --git a/tests/cases/standalone/common/order/order_variable_size_payload.sql b/tests/cases/standalone/common/order/order_variable_size_payload.sql index d8a41725b209..d9b6ea2ac4e8 100644 --- a/tests/cases/standalone/common/order/order_variable_size_payload.sql +++ b/tests/cases/standalone/common/order/order_variable_size_payload.sql @@ -2,6 +2,7 @@ create table t0 (c0 varchar, t TIMESTAMP TIME INDEX); insert into t0 values ('a', 1), (NULL,2), (NULL, 3), (NULL, 4), (NULL, 5), (NULL,6), (NULL,7); +-- SQLNESS SORT_RESULT 2 2 SELECT * FROM t0 ORDER BY t0.c0 DESC; CREATE TABLE test0 (job VARCHAR, name VARCHAR, t TIMESTAMP TIME INDEX); diff --git a/tests/conf/datanode-test.toml.template b/tests/conf/datanode-test.toml.template index 2aa63829033f..a7ce09693fe7 100644 --- a/tests/conf/datanode-test.toml.template +++ b/tests/conf/datanode-test.toml.template @@ -1,5 +1,6 @@ node_id = 1 mode = 'distributed' +require_lease_before_startup = true rpc_addr = '127.0.0.1:4100' rpc_hostname = '127.0.0.1' rpc_runtime_size = 8 diff --git a/tests/conf/standalone-test.toml.template b/tests/conf/standalone-test.toml.template index ef6fcff866c1..f81f73b9a24e 100644 --- a/tests/conf/standalone-test.toml.template +++ b/tests/conf/standalone-test.toml.template @@ -1,5 +1,6 @@ mode = 'standalone' enable_memory_catalog = false +require_lease_before_startup = true [wal] file_size = '1GB' diff --git a/tests/runner/src/env.rs b/tests/runner/src/env.rs index 7ac111fb8af2..461c81d9486a 100644 --- a/tests/runner/src/env.rs +++ b/tests/runner/src/env.rs @@ -180,6 +180,8 @@ impl Env { "start".to_string(), "--use-memory-store".to_string(), "true".to_string(), + "--enable-region-failover".to_string(), + "false".to_string(), "--http-addr=127.0.0.1:5001".to_string(), ]; (args, METASRV_ADDR.to_string())