diff --git a/docs/dev/protocol-extensions.md b/docs/dev/protocol-extensions.md index 912cf1c68f..f3762ff534 100644 --- a/docs/dev/protocol-extensions.md +++ b/docs/dev/protocol-extensions.md @@ -74,6 +74,8 @@ The keys and values are: as an indicator to which shard client wants to connect. The desired shard number is calculated as: `desired_shard_no = client_port % SCYLLA_NR_SHARDS`. Its value is a decimal representation of type `uint16_t`, by default `19142`. + - `CLIENT_OPTIONS` is a string containing a JSON object representation that + contains CQL Driver configuration, e.g. load balancing policy, retry policy, timeouts, etc. Currently, one `SCYLLA_SHARDING_ALGORITHM` is defined, `biased-token-round-robin`. To apply the algorithm, diff --git a/transport/server.cc b/transport/server.cc index 89f70e6702..a42b058e02 100644 --- a/transport/server.cc +++ b/transport/server.cc @@ -1653,6 +1653,9 @@ std::unique_ptr cql_server::connection::make_supported(int opts.insert({"CQL_VERSION", cql3::query_processor::CQL_VERSION}); opts.insert({"COMPRESSION", "lz4"}); opts.insert({"COMPRESSION", "snappy"}); + // CLIENT_OPTIONS value is a JSON string that can be used to pass client-specific configuration, + // e.g. CQL driver configuration. + opts.insert({"CLIENT_OPTIONS", ""}); if (_server._config.allow_shard_aware_drivers) { opts.insert({"SCYLLA_SHARD", format("{:d}", this_shard_id())}); opts.insert({"SCYLLA_NR_SHARDS", format("{:d}", smp::count)});