Skip to content

Client config reporting — stage 2: full DRIVER_CONFIG report#968

Draft
nikagra wants to merge 2 commits into
scylladb:scylla-4.xfrom
nikagra:feature/driver-config-reporting-phase2
Draft

Client config reporting — stage 2: full DRIVER_CONFIG report#968
nikagra wants to merge 2 commits into
scylladb:scylla-4.xfrom
nikagra:feature/driver-config-reporting-phase2

Conversation

@nikagra

@nikagra nikagra commented Jul 22, 2026

Copy link
Copy Markdown

What

Stage 2 of driver configuration reporting: fills in the full DRIVER_CONFIG JSON report, replacing the stage-1 {"version":1} placeholder. When advanced.client-config-reporting.enabled = true, the control connection now reports the driver's effective configuration as the cross-driver schema shape.

Stacked on #967 (stage 1). This branch is based on the stage-1 branch, so its diff includes the stage-1 commit until #967 merges — review the second commit (feat: populate the full DRIVER_CONFIG report) for stage-2 changes, and merge after #967.

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):

  • connection / socket / control_pane_settings — timeouts (ms), TCP/socket options. Keys the Java driver has no equivalent for (socket read/write timeout, server-side internal-query USING TIMEOUT) are reported as null.
  • reconnection_policy / retry_policy / speculative_execution_policy — a discriminated object selected by the configured policy class (exponential/constant, standard-error-aware/downgrading-consistency, constant/none), with a custom fallback carrying the user policy's class name.
  • load_balancing_policy — normalized flags for DefaultLoadBalancingPolicy (token_aware, dc_failover, explicit-vs-inferred local_dc, local_rack, ...); 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, keystores, or host lists).

Reporting remains fail-safe: any failure while building the report is swallowed; SESSION_ID is still emitted and only the config blob is dropped.

Reconciliation decisions (Java ↔ schema)

  • load_balancing_policy.shufflefalse (Java has no replica-shuffle option).
  • control_pane_settings.system_query_server_side_timeout_msnull (Java's metadata timeout is client-side; it does not emit USING TIMEOUT).
  • Custom policies → {type:"custom", name:<class simple name>} only (no reflective attribute dump in v1).

Testing

  • DefaultDriverConfigReporterTest expanded 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 from OptionsMap.driverDefaults().
  • Context package + config-consistency + ProtocolInitHandlerTest green.

Follow-up

  • Integration test against a live ScyllaDB: connect, SELECT client_options['DRIVER_CONFIG'], client_options['SESSION_ID'] FROM system.clients, assert the JSON is schema-valid and SESSION_ID is identical across a session's rows. (Needs a running cluster; not included here.)
  • Confirm the server prerequisite before flipping the flag default on (unknown STARTUP key tolerance + client_options value-length).

🤖 Generated with Claude Code

nikagra and others added 2 commits July 22, 2026 16:48
…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>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 403e0a26-26f1-43b6-9407-dd401d89ebf1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant