CNS-136: expose statement logging sample rate in the operator chart - #38406
Conversation
The operator chart passed `--disable-statement-logging` unconditionally, which made orchestratord set `statement_logging_max_sample_rate=0` and left query history permanently empty in self-managed installs. Replace the boolean orchestratord flag with `--statement-logging-max-sample-rate=<f64>`, surfaced as the `operator.args.statementLoggingMaxSampleRate` chart value. It defaults to 0.1, which keeps the sampling cost that motivated the original opt-out bounded while making query history usable. Setting it to 0 still fully disables statement logging, and leaving it empty falls back to environmentd's own default.
Only a null value omits the flag, an empty string renders an argument orchestratord cannot parse. Name environmentd's own default so the comment stands on its own.
QA LLM Review1. MEDIUM -- Sample rate does not bound statement-logging storage, which is never reclaimed
Turning the default from "off" to DetailsTwo mechanisms make this concrete.
Note also that If the goal is a bounded cost rather than bounded sampling, the lever that actually caps bytes is 2. LOW -- Out-of-range sample rate is rejected two layers away, at environmentd startup
The new value is passed through the chart and orchestratord unvalidated, but environmentd constrains DetailsThe chart has no Blast radius is limited: a rollout only starts when one is requested ( |
environmentd rejects a rate outside [0, 1] by refusing to open its catalog, so a plausible typo such as 10 surfaced as a new generation failing to boot. Reject it at argument-parse time instead. The sample rate bounds the fraction of statements recorded, not the size of the history: sustained write volume is capped by statement_logging_target_data_rate, and the history is never truncated. Say so rather than implying the rate bounds storage.
The sample rate bounds the fraction of statements recorded, not the volume written. On busy environments the target data rate is the binding limit, so it is the lever that actually caps how fast query history grows. Expose it alongside the sample rate, defaulting to unset so environmentd's own default applies.
|
Thanks, both findings verified against the code and both addressed. 1 (storage) — acted on, partly. Confirmed all three mechanics: the five collections are excluded from truncation ( The consequence for this PR is that my values.yaml comment was wrong: it implied the sample rate bounds storage. Corrected to state that it bounds the sampled fraction, that sustained volume is capped separately by Taking your suggestion, On shipping 2 (range validation) — fixed. Added a
On |
QA LLM Review1. MEDIUM --
|
Helm parses values files through YAML to JSON, so numbers arrive as float64 and print in exponential form at or above 1e6. A byte-rate knob invites values that large, and orchestratord's usize parser rejects 1.048576e+06, crashlooping the operator while helm upgrade reports success. Coerce with int64, which handles both the float64 from a values file and the int64 from --set.
|
Confirmed and fixed in a0d9a91. Good catch, this was a real crashloop. Reproduced the whole chain before fixing. Values file at Threshold is exactly where you said, 999999 renders literally and 1000000 becomes Also confirmed your note that Two clarifications on the writeup:
|
check-copyright covers .yaml, so the new fixture failed lint-and-rustfmt.
QA LLM Review1. MEDIUM -- A non-numeric
|
https://linear.app/materializeinc/issue/CNS-136/helm-chart-stop-hard-disabling-statement-logging-expose-sample-rate-as
Problem
The operator chart passed
--disable-statement-loggingunconditionally, so orchestratord always emitted--system-parameter-default=statement_logging_max_sample_rate=0and query history was permanently empty in self-managed installs. There was no way to turn it back on short of forking the chart.Solution
Replace the boolean orchestratord flag with
--statement-logging-max-sample-rate=<f64>(Option<f64>, unset means no override), surfaced as theoperator.args.statementLoggingMaxSampleRatechart value, defaulting to0.1.0still fully disables statement logging, andnullinherits environmentd's own default of0.99. The flag range-checks[0, 1]at parse time, since environmentd rejects a violating value by refusing to open its catalog.The sample rate bounds the fraction of statements recorded, not the volume written: above ~2 KB/s of row bytes the
statement_logging_target_data_ratethrottle is the binding limit. Sooperator.args.statementLoggingTargetDataRateis exposed alongside it, defaulting to unset, as the lever that actually caps how fast query history grows.Testing
helm unittest misc/helm-charts/operator(42 tests) covers the default, a custom rate,0, and unset for both values.cargo check/clippy/test -p mz-orchestratord,bin/fmt, andci/test/lint-main/checks/check-helm-docs.shpass. Range validation verified against the built binary. No cluster needed.For the reviewer
enableInternalStatementLogging: truedefault was inert while the max rate was pinned at 0, and now becomes live. Internal-user statements (console polling,mz_system) share the same effective rate. Left alone deliberately to keep this PR from changing a second default, but worth a decision on whether it should flip.0.99; self-managed at0.1is strictly cheaper. Bounding cumulative size needs truncation, which is out of scope here.UpToDate=False/WaitingForApprovalafter the operator upgrade, and the fix only lands for them once a rollout is requested.--disable-statement-logging. It does break a pinned-old-operator.image.tag+ new-chart combination, as any generation-affecting flag change would.🤖 Generated with Claude Code