add a way to negotiate generation of the tablet info for drivers

Tablets metadata is quite expensive to generate (each data_value is
an allocation), so an old driver (without support for tablets) will
generate huge amounts of such notifications. This commit adds a way
to negotiate generation of the notification: a new driver will ask
for them, and an old driver won't get them. It uses the
OPTIONS/SUPPORTED/STARTUP protocol described in native_protocol_v4.spec.

Closes scylladb/scylladb#16611
This commit is contained in:
Sylwia Szunejko
2024-01-02 14:54:01 +01:00
committed by Avi Kivity
parent 2508d33946
commit 91a5a41313
6 changed files with 25 additions and 6 deletions

View File

@@ -190,6 +190,9 @@ private:
auto make_query_state() {
if (_db.local().has_keyspace(ks_name)) {
_core_local.local().client_state.set_keyspace(_db.local(), ks_name);
cql_transport::cql_protocol_extension_enum_set cql_proto_exts;
cql_proto_exts.set(cql_transport::cql_protocol_extension::TABLETS_ROUTING_V1);
_core_local.local().client_state.set_protocol_extensions(std::move(cql_proto_exts));
}
return ::make_shared<service::query_state>(_core_local.local().client_state, empty_service_permit());
}