Client config reporting — stage 2: full DRIVER_CONFIG report#968
Draft
nikagra wants to merge 2 commits into
Draft
Client config reporting — stage 2: full DRIVER_CONFIG report#968nikagra wants to merge 2 commits into
nikagra wants to merge 2 commits into
Conversation
…plumbing)
Stage 1 of driver configuration reporting: the mechanism to report a client's
effective configuration to ScyllaDB at connection time, so operators can inspect
driver settings (via system.clients.client_options) while investigating incidents.
Gated behind a new option, advanced.client-config-reporting.enabled, which
ships disabled — when off there is zero change on the wire. When enabled:
- SESSION_ID: a dedicated, driver-generated per-session UUID, sent on every
connection (control and pool) so the server can group a session's
connections. Independent of the user-settable CLIENT_ID.
- DRIVER_CONFIG: a compact JSON blob, sent only on the control connection.
Stage 1 emits only {"version":1}; the full configuration report follows in
stage 2.
Both entries are produced by a new DriverConfigReporter, invoked per connection
from ProtocolInitHandler and evaluated fresh (so toggling the flag at runtime
takes effect on new connections). Reporting is fail-safe: any failure while
building the report is swallowed and never breaks connection initialization.
The config option is registered consistently across DefaultDriverOption,
TypedDriverOption, OptionsMap.driverDefaults() and reference.conf.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fills in DefaultDriverConfigReporter with all configuration groups of the
cross-driver schema, replacing the stage-1 {"version":1} placeholder:
- connection, socket, control_pane_settings: mapped from the default profile
(timeouts in ms; keys with no Java equivalent — read/write timeout,
server-side internal-query timeout — reported as null).
- reconnection_policy / retry_policy / speculative_execution_policy: a
discriminated object chosen by the configured policy class, with a "custom"
fallback carrying the class name for user policies.
- load_balancing_policy: normalized flags for DefaultLoadBalancingPolicy
(token-aware, dc-failover, explicit/inferred local dc, ...), "custom"
otherwise.
- connection_pool, query_defaults, tls: pool sizing / shard-aware port,
per-request defaults (page size, consistency, idempotence, client
timestamps), and TLS booleans only (never credentials or hosts).
Values are read from the default execution profile and the context's policy
accessors on each control-connection init, so the report reflects the current
(possibly reloaded) configuration. Building remains fail-safe.
Adds unit coverage for the default report shape and each policy discrimination
branch, driven by OptionsMap.driverDefaults().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Stage 2 of driver configuration reporting: fills in the full
DRIVER_CONFIGJSON report, replacing the stage-1{"version":1}placeholder. Whenadvanced.client-config-reporting.enabled = true, the control connection now reports the driver's effective configuration as the cross-driver schema shape.The report
All 11 groups are populated from the default execution profile and the context's policies, rebuilt on each control-connection init (so it reflects the current, possibly reloaded, config):
USING TIMEOUT) are reported asnull.exponential/constant,standard-error-aware/downgrading-consistency,constant/none), with acustomfallback carrying the user policy's class name.DefaultLoadBalancingPolicy(token_aware,dc_failover, explicit-vs-inferredlocal_dc,local_rack, ...);customotherwise.Reporting remains fail-safe: any failure while building the report is swallowed;
SESSION_IDis still emitted and only the config blob is dropped.Reconciliation decisions (Java ↔ schema)
load_balancing_policy.shuffle→false(Java has no replica-shuffle option).control_pane_settings.system_query_server_side_timeout_ms→null(Java's metadata timeout is client-side; it does not emitUSING TIMEOUT).{type:"custom", name:<class simple name>}only (no reflective attribute dump in v1).Testing
DefaultDriverConfigReporterTestexpanded to 17 tests: the default report shape (golden), each policy discrimination branch, explicit local-dc, server-side timestamps, TLS enabled, socket overrides, unbounded page size, plus the stage-1 gating/fail-safe cases. Report content is asserted against a real config fromOptionsMap.driverDefaults().ProtocolInitHandlerTestgreen.Follow-up
SELECT client_options['DRIVER_CONFIG'], client_options['SESSION_ID'] FROM system.clients, assert the JSON is schema-valid andSESSION_IDis identical across a session's rows. (Needs a running cluster; not included here.)STARTUPkey tolerance +client_optionsvalue-length).🤖 Generated with Claude Code