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
Bumped MSRV to 1.94 (#1909, #2003).- Added a
serdefeature, which derives serde’sSerializeandDeserializefor 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
Sessionor onDefaultPolicy, is not present in the cluster, or all of its nodes are disabled by theHostFilter. 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,NativeTypeandCollectionTypenow implementDisplay, 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_configpublic (behindunstable-client-routes) (#1990).
Performance
- Executing requests is much cheaper. A prepared
INSERTnow makes 2 allocations instead of 8, an unpagedSELECT3 instead of 8, and the futures returned bySessionmethods are up to 70% smaller. In our benchmark of preparedINSERTs, 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 aVec<f32>is about 9 times faster (#1924). - Serializing values is faster: vectors of variable-size elements and
CqlDurationno longer allocate, and aCqlValueUDT with fields in schema order no longer builds aHashMap(#2006).
Bug fixes
- After
Session::use_keyspacereturns, 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
STARTUPmessage, visible insystem.clients. Driver 1.9.0 reported2.0.0, the version ofscylla-cql(#2026). - A batch that contains an LWT prepared statement is now routed as an LWT (
RoutingInfo::is_confirmed_lwtis set), like the statement itself would be. Previously batches were never routed as LWTs (#1944).
Deserializing an empty varintnow fails, as it already did fordecimal; useMaybeEmpty<T>to accept empty values. PreviouslyCqlVarintaccepted it, and num-bigint’sBigIntturned it into 0. Decimals with an empty unscaled value are now rejected, an emptyCqlVarintno longer equals 0, and aCqlVarintwith redundant leading0xffbytes now equals its normalized form (#2004).
ClusterState::get_token_endpointsno longer guessesLocalStrategyfor keyspaces missing from metadata. It is deprecated in favour of the newClusterState::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 withUSE 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-proxyinstead 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-proxyin dry mode, or moved to integration tests.make unit-testruns them without starting the cluster (#1967). scylla-proxyno 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:
- https://github.com/scylladb/scylla-rust-driver
Contributions are most welcome!
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] |