From 82c449289f4a675e91e0fa0c6f3f9a22f1acaeb3 Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 12 Jun 2024 11:30:14 +0200 Subject: [PATCH 1/5] CI: print versions of tools from rust toolchain --- .github/workflows/rust.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8fbfab11e8..bae8c8b8b1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -26,6 +26,12 @@ jobs: run: | sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr" docker compose -f test/cluster/docker-compose.yml up -d --wait + - name: Print rustc version + run: rustc --version + - name: Print rustfmt version + run: cargo fmt --version + - name: Print clippy version + run: cargo clippy --version - name: Format check run: cargo fmt --verbose --all -- --check - name: Clippy check From 1238c13553027d04847e4c907ba0cf9ffbe80c7f Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 12 Jun 2024 13:28:19 +0200 Subject: [PATCH 2/5] cargo: put restrictions on tokio version We decided to bump minimum required version of tokio to 1.34. Currently, the newest tokio version is 1.38, but some of the integration tests are eaten when testing with this specific verstion of tokio. Which is why, as of now, we decided not to support this version. The issue with version 1.38 is related to #[tokio::test] and #[ntest::timeout] attributes. Refs: - https://github.com/tokio-rs/tokio/issues/6610 - https://github.com/becheran/ntest/pull/28 - https://github.com/tokio-rs/tokio/pull/6497 --- examples/Cargo.toml | 17 +++++++++++++---- scylla-cql/Cargo.toml | 3 ++- scylla-proxy/Cargo.toml | 6 ++++-- scylla/Cargo.toml | 8 +++++--- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index edd817293d..d71e413675 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -10,13 +10,22 @@ futures = "0.3.6" openssl = "0.10.32" rustyline = "9" rustyline-derive = "0.6" -scylla = {path = "../scylla", features = ["ssl", "cloud", "chrono", "time", "num-bigint-03", "num-bigint-04", "bigdecimal-04"]} -tokio = {version = "1.1.0", features = ["full"]} -tracing = { version = "0.1.25" , features = ["log"] } +scylla = { path = "../scylla", features = [ + "ssl", + "cloud", + "chrono", + "time", + "num-bigint-03", + "num-bigint-04", + "bigdecimal-04", +] } +# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed +tokio = { version = ">=1.34, <1.38", features = ["full"] } +tracing = { version = "0.1.25", features = ["log"] } tracing-subscriber = { version = "0.3.14", features = ["env-filter"] } chrono = { version = "0.4", default-features = false } time = { version = "0.3.22" } -uuid = { version = "1.0", features = ["v1"]} +uuid = { version = "1.0", features = ["v1"] } tower = "0.4" stats_alloc = "0.1" clap = { version = "3.2.4", features = ["derive"] } diff --git a/scylla-cql/Cargo.toml b/scylla-cql/Cargo.toml index b81ecb69c9..042564fd25 100644 --- a/scylla-cql/Cargo.toml +++ b/scylla-cql/Cargo.toml @@ -13,7 +13,8 @@ license = "MIT OR Apache-2.0" scylla-macros = { version = "0.5.0", path = "../scylla-macros" } byteorder = "1.3.4" bytes = "1.0.1" -tokio = { version = "1.12", features = ["io-util", "time"] } +# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed +tokio = { version = ">=1.34, <1.38", features = ["io-util", "time"] } secrecy = { version = "0.7.0", optional = true } snap = "1.0" uuid = "1.0" diff --git a/scylla-proxy/Cargo.toml b/scylla-proxy/Cargo.toml index 694fb32a58..5e2d547753 100644 --- a/scylla-proxy/Cargo.toml +++ b/scylla-proxy/Cargo.toml @@ -17,7 +17,8 @@ scylla-cql = { version = "0.2.0", path = "../scylla-cql" } byteorder = "1.3.4" bytes = "1.2.0" futures = "0.3.6" -tokio = { version = "1.12", features = [ +# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed +tokio = { version = ">=1.34, <1.38", features = [ "net", "time", "io-util", @@ -38,7 +39,8 @@ rand = "0.8.5" assert_matches = "1.5.0" ntest = "0.9.0" tracing-subscriber = { version = "0.3.14", features = ["env-filter"] } -tokio = { version = "1.12", features = ["signal"] } +# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed +tokio = { version = ">=1.34, <1.38", features = ["signal"] } [lints.rust] unreachable_pub = "warn" diff --git a/scylla/Cargo.toml b/scylla/Cargo.toml index 5c4667c95e..490a64c80c 100644 --- a/scylla/Cargo.toml +++ b/scylla/Cargo.toml @@ -47,7 +47,8 @@ bytes = "1.0.1" futures = "0.3.6" hashbrown = "0.14" histogram = "0.6.9" -tokio = { version = "1.34", features = [ +# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed +tokio = { version = ">=1.34, <1.38", features = [ "net", "time", "io-util", @@ -83,8 +84,9 @@ num-bigint-04 = { package = "num-bigint", version = "0.4" } bigdecimal-04 = { package = "bigdecimal", version = "0.4" } scylla-proxy = { version = "0.0.3", path = "../scylla-proxy" } ntest = "0.9.0" -criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0 -tokio = { version = "1.27", features = ["test-util"] } +criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0 +# FIXME: Remove <1.38 once https://github.com/tokio-rs/tokio/issues/6610 is fixed +tokio = { version = ">=1.34, <1.38", features = ["test-util"] } tracing-subscriber = { version = "0.3.14", features = ["env-filter"] } assert_matches = "1.5.0" rand_chacha = "0.3.1" From 5abc02fbeac7cfc69014ca7e1e279f45182401cf Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 12 Jun 2024 14:58:49 +0200 Subject: [PATCH 3/5] test: disable tablets for tests with LWT --- scylla/src/transport/session_test.rs | 6 +++++- scylla/tests/integration/lwt_optimisation.rs | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scylla/src/transport/session_test.rs b/scylla/src/transport/session_test.rs index 459312dd0c..ab891c72f8 100644 --- a/scylla/src/transport/session_test.rs +++ b/scylla/src/transport/session_test.rs @@ -2424,7 +2424,11 @@ async fn test_batch_lwts() { let session = create_new_session_builder().build().await.unwrap(); let ks = unique_keyspace_name(); - session.query(format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}}", ks), &[]).await.unwrap(); + let mut create_ks = format!("CREATE KEYSPACE {} WITH REPLICATION = {{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}}", ks); + if scylla_supports_tablets(&session).await { + create_ks += " and TABLETS = { 'enabled': false}"; + } + session.query(create_ks, &[]).await.unwrap(); session.use_keyspace(ks.clone(), false).await.unwrap(); session diff --git a/scylla/tests/integration/lwt_optimisation.rs b/scylla/tests/integration/lwt_optimisation.rs index a36d7367de..da2c89bdef 100644 --- a/scylla/tests/integration/lwt_optimisation.rs +++ b/scylla/tests/integration/lwt_optimisation.rs @@ -1,5 +1,6 @@ use crate::utils::{setup_tracing, test_with_3_node_cluster}; use scylla::retry_policy::FallthroughRetryPolicy; +use scylla::test_utils::scylla_supports_tablets; use scylla::test_utils::unique_keyspace_name; use scylla::transport::session::Session; use scylla::{ExecutionProfile, SessionBuilder}; @@ -68,7 +69,11 @@ async fn if_lwt_optimisation_mark_offered_then_negotiatied_and_lwt_routed_optima // Create schema let ks = unique_keyspace_name(); - session.query(format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 3}}", ks), &[]).await.unwrap(); + let mut create_ks = format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 3}}", ks); + if scylla_supports_tablets(&session).await { + create_ks += " and TABLETS = { 'enabled': false}"; + } + session.query(create_ks, &[]).await.unwrap(); session.use_keyspace(ks, false).await.unwrap(); session From 9a6e3ee9e43a53d21a84870f0bc129cc0c603526 Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 12 Jun 2024 16:27:50 +0200 Subject: [PATCH 4/5] tests: ignore LWT test with tablets As of now, LWTs are not supported with tablets enabled. Marked the test for LWT + tablets with `#[ignore]`. --- scylla/tests/integration/tablets.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scylla/tests/integration/tablets.rs b/scylla/tests/integration/tablets.rs index 00441181a5..5f91b43d39 100644 --- a/scylla/tests/integration/tablets.rs +++ b/scylla/tests/integration/tablets.rs @@ -479,9 +479,12 @@ async fn test_tablet_feedback_not_sent_for_unprepared_queries() { /// for every tablet. /// After that it sends 100 queries fro each tablet and verifies that only 1 shard on 1 node /// recevied requests for a given tablet. +/// +/// TODO: Remove #[ignore] once LWTs are supported with tablets. #[cfg(not(scylla_cloud_tests))] #[tokio::test] #[ntest::timeout(30000)] +#[ignore] async fn test_lwt_optimization_works_with_tablets() { setup_tracing(); const TABLET_COUNT: usize = 16; From 032fe2d8ab3ee5d5f0193b6c99a54aee9285715e Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 12 Jun 2024 16:29:56 +0200 Subject: [PATCH 5/5] CI: remove tablets workflow The separate job for tablets is not needed anymore, since tablets are stable in newest release of Scylla. --- .github/workflows/tablets.yml | 38 ----------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/workflows/tablets.yml diff --git a/.github/workflows/tablets.yml b/.github/workflows/tablets.yml deleted file mode 100644 index 24e14d66a9..0000000000 --- a/.github/workflows/tablets.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Tablets - -on: - push: - branches: - - main - - 'branch-*' - pull_request: - branches: - - main - - 'branch-*' - -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: full - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v3 - - name: Install scylla-ccm - run: pip3 install https://github.com/scylladb/scylla-ccm/archive/master.zip - - - name: Create cluster with tablets enabled - run: | - ccm create tablets -i 127.0.1. -n 3 --scylla -v 'unstable/master:2024-05-01T18:26:10Z' - ccm updateconf 'experimental_features: [consistent-topology-changes, tablets]' - ccm start - - - name: Check - run: cargo check --verbose - - name: Run tablets tests - run: SCYLLA_URI=127.0.1.1:9042 SCYLLA_URI2=127.0.1.2:9042 SCYLLA_URI3=127.0.1.3:9042 cargo test --verbose - - - name: Remove tablets cluster - run: ccm remove tablets