scylladb / scylla-rust-driver

Async CQL driver for Rust, optimized for ScyllaDB!
Apache License 2.0
582 stars 104 forks source link

Change the way tablet support is checked in tests #1048

Open Lorak-mmk opened 3 months ago

Lorak-mmk commented 3 months ago

It is possible for Scylla to support tablets, but for them to be disabled in config. In that case our current check:

pub async fn scylla_supports_tablets(session: &Session) -> bool {
    let result = session
        .query(
            "select column_name from system_schema.columns where 
                keyspace_name = 'system_schema'
                and table_name = 'scylla_keyspaces'
                and column_name = 'initial_tablets'",
            &[],
        )
        .await
        .unwrap();
    result.single_row().is_ok()
}

will succeed, but it will not be possible to create a tablets table. It will fail with message like this:

Unique name: test_rust_1721129687_11
thread '<unnamed>' panicked at scylla/tests/integration/tablets.rs:264:10:
called `Result::unwrap()` on an `Err` value: DbError(ConfigError, "Tablet replication is not enabled")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tablets::test_default_policy_is_tablet_aware' panicked at scylla/tests/integration/tablets.rs:288:1:
explicit panic

We should check this differently. @michoecho suggested checking TABLETS cluster feature. We have a supports_feature function for this.