[RELEASE] ScyllaDB Rust Driver 1.10.0

The ScyllaDB team is pleased to announce ScyllaDB Rust Driver 1.10.0,
an asynchronous CQL driver for Rust, optimized for ScyllaDB, but also compatible with Apache Cassandra!

Some interesting statistics:

  • over 11.2M downloads on crates.io!
  • over 691 GitHub stars!

Changes

Deprecations and necessary code adjustments

Deprecation of ClusterState::get_token_endpoints

ClusterState::get_token_endpoints was deprecated in favour of the new ClusterState::try_get_token_endpoints. If you don’t call get_token_endpoints, you are not affected.

For a keyspace missing from the driver’s metadata, get_token_endpoints used to guess LocalStrategy, and returned replicas unrelated to the real ones. It now returns an empty list, which can’t be told apart from an empty replica set. try_get_token_endpoints returns ClusterStateTokenError::UnknownTable in this case. Replace your calls with try_get_token_endpoints and handle the error.

scylla-cql 3.0

As in 1.9.0, this release bumps the major version of scylla-cql, our internal protocol implementation crate, without breaking the API of scylla. We used the opportunity to remove legacy items: for example, the V2 types replace the types they were added next to, and lose the suffix (Execute, Request, Event…) (#2026, #2028).

If you only have the scylla crate in your Cargo.toml (as you typically should), you do not need to do anything.

If you have scylla-cql in your Cargo.toml, your code will keep compiling and working, with a different version of scylla-cql than the one the driver uses. In general you should have no need to depend on scylla-cql directly, so try to remove this dependency. If you can’t, update to 3.0 to keep in sync with the driver and avoid code bloat.

New features / enhancements

  • :warning: Bumped MSRV to 1.94 (#1909, #2003).
  • Added a serde feature, which derives serde’s Serialize and Deserialize for the driver’s CQL value types (CqlDate, CqlTimestamp, CqlVarint…), so you can use them in your serde-serialized structures. Their serde representations are not covered by semver guarantees, but any change will be announced in the release notes (#1912).
  • The driver now logs a warning if the preferred datacenter or rack, set on the Session or on DefaultPolicy, is not present in the cluster, or all of its nodes are disabled by the HostFilter. Previously such a misconfiguration led to confusing behaviour, like empty query plans. Warnings that load balancing policies may emit on every request are now rate limited (#2008).
  • TABLETS_ROUTING_V2 support now covers batches: a batch routed by its first statement carries a routing hint, and the driver learns tablet routing from the response. The driver now negotiates the extension only under its new name, TABLETS_ROUTING_V2_EXPERIMENTAL_V2, so it no longer uses TABLETS_ROUTING_V2 with ScyllaDB versions that only support the old one (#1999, #2032).
  • Added Node::is_scylladb, which tells whether a node is ScyllaDB, even when it runs with shard awareness disabled (#1971).
  • ColumnType, NativeType and CollectionType now implement Display, printing the type in CQL syntax, e.g. map<text, frozen<map<text, text>>> (#1960).
  • Client-route DNS lookup failures now report the node’s host ID and the hostname that failed to resolve. Previously the error showed only the untranslated node address, which made it look like a lookup of a numeric IP (#2020).
  • A response on an unexpected stream id, which breaks the connection and means a bug in the driver or the database, is now logged as a warning instead of at debug level (#2014).
  • Made SessionConfig::client_routes_config public (behind unstable-client-routes) (#1990).

Performance

  • Executing requests is much cheaper. A prepared INSERT now makes 2 allocations instead of 8, an unpaged SELECT 3 instead of 8, and the futures returned by Session methods are up to 70% smaller. In our benchmark of prepared INSERTs, the driver uses about 35% less CPU per request (#1978, #1979, #1980, #1981, #1982, #1983, #1984, #1985).
  • Learning tablets is much cheaper: a tablet update no longer copies the whole cluster metadata, feedback about already known tablets is skipped, and tablets take less memory. In our benchmark, learning the tablets of a table takes 21 times fewer allocations (#1920, #2015).
  • Tablet feedback is no longer delayed by topology changes. Previously, the driver waited for the connection pools of the new topology to connect (up to connect_timeout) before handling more feedback. Now it waits only in the very rare edge cases (#1925).
  • Deserializing collections is faster: lists, sets, maps and vectors are now built with one allocation instead of about 10. Deserializing a vector<float, 1536> into a Vec<f32> is about 9 times faster (#1924).
  • Serializing values is faster: vectors of variable-size elements and CqlDuration no longer allocate, and a CqlValue UDT with fields in schema order no longer builds a HashMap (#2006).

Bug fixes

  • After Session::use_keyspace returns, all existing and new connections now use the new keyspace. Previously concurrent calls, or a failed or timed out keyspace switch, could leave the session permanently with connections to different keyspaces. Setting the keyspace on a new connection now also has a timeout (#1909).
  • The driver now reports its own version in the STARTUP message, visible in system.clients. Driver 1.9.0 reported 2.0.0, the version of scylla-cql (#2026).
  • A batch that contains an LWT prepared statement is now routed as an LWT (RoutingInfo::is_confirmed_lwt is set), like the statement itself would be. Previously batches were never routed as LWTs (#1944).
  • :warning: Deserializing an empty varint now fails, as it already did for decimal; use MaybeEmpty<T> to accept empty values. Previously CqlVarint accepted it, and num-bigint’s BigInt turned it into 0. Decimals with an empty unscaled value are now rejected, an empty CqlVarint no longer equals 0, and a CqlVarint with redundant leading 0xff bytes now equals its normalized form (#2004).
  • :warning: ClusterState::get_token_endpoints no longer guesses LocalStrategy for keyspaces missing from metadata. It is deprecated in favour of the new ClusterState::try_get_token_endpoints (see above) (#1913, #2027).
  • The parser of custom type names (e.g. org.apache.cassandra.db.marshal.Int32Type) now rejects trailing characters instead of ignoring them (#1911).

Internal refactors

  • Fixed new warnings produced by Clippy 1.99 (#1948).

Documentation

  • Documented the guarantees of Session::use_keyspace, and added a warning about using prepared statements together with USE KEYSPACE (#1909).
  • Documented that when a retry policy changes the consistency, the load balancing plan is not recomputed, which matters for policies that route based on consistency (#1914).
  • Reworded the client routes docs. The client routes and vector chapters were missing from the mdbook, so their examples were not tested; now they are (#1948).
  • Fixed the docs of Node::sharder, which said that a node without a sharder is not ScyllaDB. ScyllaDB with shard awareness disabled has no sharder either (#1970).

CI / tests / developer tool improvements

  • Added integration tests for batches, for serialization of all scalar types, for statement parameters and timestamps, and for statement caching of CachingSession (#1897, #1898, #1900, #1901).
  • Fixed flaky tests. Schema agreement and pager timeout tests now use responses forged by scylla-proxy instead of a real cluster, and other tests now wait for the state they need (#1915, #1919, #1938, #1943, #1955, #1966, #2001).
  • Unit tests no longer need a cluster: they use scylla-proxy in dry mode, or moved to integration tests. make unit-test runs them without starting the cluster (#1967).
  • scylla-proxy no longer slows down connections, because it now disables Nagle’s algorithm. This cut the test suite time by about 19%. Also fixed several proxy bugs (#1949).
  • Added benchmarks for tablet learning, collection deserialization and value serialization (#1920, #1924, #2006), and fixed benchmark report generation after the gungraun 0.20 update (#1957).
  • Code coverage is now reported to Codecov, without test support and tooling crates (#1940, #1991).
  • Prepared CI for GitHub’s merge queue, and trimmed Renovate PR descriptions, which the merge queue copies into commit messages (#1939, #1954).
  • Hardened GitHub Actions: privileged jobs no longer restore caches, and actions used only in unprivileged jobs are updated sooner (#1961).
  • Benchmarks and semver checks can check out fork PRs again after the actions/checkout v7 update, and semver checks use upstream cargo-semver-checks instead of a fork (#1936, #1958).
  • Added a policy for external contributions to CONTRIBUTING.md, and N/A boxes and ownership points to the PR checklist (#1945, #1972).

Dependencies

  • Updates to our JIRA automation (#1926, #1973, #1993).
  • Updates to the Scylla version used in tests, up to 2026.3.4 (#1927, #1950, #1975, #1995).
  • Updated taiki-e/install-action, up to v2.88.0 (#1928, #1951, #1989, #2012).
  • Updated actions/checkout to v7.0.1 (#1929, #1994).
  • Updated actions-rust-lang/setup-rust-toolchain to v2.0.0 (#1931, #2013).
  • Updated the jsonschema Rust crate to 0.60 (#1932, #1988, #1996).
  • Updated the gungraun Rust crate to 0.20.0 (#1933).
  • Updated astral-sh/setup-uv to v9.0.0 (#1952, #1974, #1997).
  • Updated EmbarkStudios/cargo-deny-action (#1987).
  • Updated actions/upload-artifact to v7.0.2 (#2011).
  • Updated sphinx-multiversion-scylla to 0.3.9 (#1998).

Congrats to all contributors and thanks to everyone for using our driver!


The source code of the driver can be found here:

The official crates.io registry entry is here:

Thank you for your attention, please do not hesitate to contact us if you have any questions, issues, feature requests, or are simply interested in our driver!

Contributors since the last release:

commits author
283 Karol Baryła
24 renovate[bot]
18 Wojciech Przytuła
9 Dawid Mędrek
6 sylwiaszunejko
4 Dawid Pawlik
2 Alexey Kartashov
1 Claude
1 Dmitriy Kruglov
1 Dmitry Kropachev
1 Photon101
1 Wojciech Bączkowski
1 boulea7
1 dependabot[bot]
1 Like