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 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 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" 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 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;