[RELEASE] ScyllaDB Rust Driver 1.9.0

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

Some interesting statistics:

  • over 8.7M downloads on crates.io!
  • over 688 GitHub stars!

Changes

Deprecations and necessary code adjustments

Deprecation of TlsContext::OpenSsl010

TlsContext::OpenSsl010 was deprecated, and replaced with TlsContext::OpenSsl010Config. The new variant allows the driver to use TLS tickets in order to lessen the server load when establishing new connections.
TlsContext::OpenSsl010 stored a bare openssl::ssl::SslContext. This is not enough for the driver to support tickets, so the new variant can only be constructed from a builder, not a ready context. Two ways to do that:

  • Recommended: from SslConnectorBuilder. You can just pass Option<SslConnectorBuilder> to SessionBuilder::tls_context, because there is impl From<SslConnectorBuilder> for TlsContext. If you wish to disable TLS tickets (or do other configuration that might get introduced in the future), then first convert your SslConnectorBuilder to our OpenSsl010Config, either with OpenSsl010Config::new or impl From<SslConnectorBuilder> for OpenSsl010Config.
  • From SslContextBuilder. This is easier to migrate to, but not recommended: SslContextBuilder defaults are less safe than SslConnectorBuilder. Use OpenSsl010Config::from_dangerous_builder to do that.

scylla-cql 2.0

The driver consists of 4 main crates, which until now were always released in sync with the same version number: scylla (main crate), scylla-cql (protocol implementation), scylla-cql-core (recently extracted from scylla-cql, consisting of the parts of the protocol implementation that are public in scylla), scylla-macros (derive macros for our ser / deser traits).

The scylla-cql-core extraction made scylla-cql a fully internal crate: we can bump its major version number without having to do the same for scylla. This is what we do in this release, because of a breaking change we had to make in scylla-cql.

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

If for some reason you have scylla-cql in your Cargo.toml, your code will keep compiling and working. You will be using a different version (1.x) of scylla-cql than the driver uses (2.x). Everything works, because all the common parts are extracted to scylla-cql-core.

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 2.0 to keep in sync with the driver and avoid code bloat.

New features / enhancements

  • Implemented a new statement type: BoundStatement. It allows you to pre-serialize request parameters, move them around together with the statement in its owned form, and calculate a token based on that (#1862, #1866, #1883).
  • The driver will now report many parts of its configuration in the STARTUP message of a control connection. This data can be seen in the system.clients table and is intended for debugging / diagnostic purposes. You can disable it with SessionBuilder::driver_config_reporting(false) (#1905).
  • Implemented TLS tickets support for the OpenSSL backend. Rustls supports them automatically, so no changes were necessary on our side (#1794, #1874, #1875).
  • Each driver connection now sends a SESSION_ID in the STARTUP frame. This is visible in the system.clients table and can be used to associate different connections of a single driver session (#1882).
  • Previously, the driver refreshed all metadata (schema, topology) periodically (by default, every 60s). This could be costly, especially if you have many clients. Now the driver correctly reacts to CQL events, and only fetches what is necessary. It aggregates schema change events, and periodically fetches only the parts of the schema that were indicated as changed by events (#1849, #1850, #1853).
  • Implemented TABLETS_ROUTING_V2 extension support, currently experimental in Scylla, and leader-aware routing for Scylla’s upcoming Strong Consistency mode (#1788, #1887, #1890).
  • If a connection pool opens a connection to a different node than it expected, most likely due to network misconfiguration, an error! will now be logged (on recent Scylla versions only) (#1872).

Bug fixes

  • Connection metrics are now correctly balanced when clearing pools or rejecting an unnecessary connection (#1801).
  • Keyspace change failures on connection startup are no longer ignored; they now correctly defunct the connection (#1801).
  • The driver now uses one ClusterState for the whole request (previously some tracing logs could use a different one) (#1885).
  • Pager now only computes replicas for tracing purposes when the trace they are used in is actually enabled (#1904).
  • scylla-proxy used in tests now selects its address from the address family of the real node address (#1902).
  • VectorSerializationErrorKind is now re-exported in the scylla crate (#1899).

Internal refactors

  • Fixed new warnings produced by Clippy 1.98 (#1854).

Documentation

  • Changed all doc comments and the documentation book to remove trailing backslashes (#1878).
  • Our docs / examples / tests no longer rely on autogenerated names of unnamed bind markers (#1870).
  • Expanded our custom serialization / deserialization examples (#1831).

CI / tests / developer tool improvements

  • Added code coverage measurement for unit and integration tests (#1844).
  • Introduced cargo-deny to our CI (#1848).
  • Added integration tests for compression (#1896).
  • Changed more integration tests to use tablets (#1861).
  • Added an integration test for SELECT without FROM (new Scylla feature) (#1879).
  • Added tests for the orphaning mechanism (#1863, #1873).

Dependencies

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
66 Karol Baryła
29 Wojciech Przytuła
17 Dawid Mędrek
15 renovate[bot]
5 Piotr Dulikowski
4 Guflly
3 w3lld1
1 ColumbusLabs
1 Israel Fruchter
1 Roy Dahan
1 송은우