fix(inkless:controller): reject a topic type flag that isn't true or false #899
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 424 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.362
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #899"
general
weight: 0.35
giuseppelillo
A
diskless.enablevalue with surrounding whitespace, such as" true", makes the controller run the classic-to-diskless switch on a topic that was born diskless. With this change the controller rejects such a value.Problem
ConfigDeftrims a boolean before it parses it, so a create or an alter acceptsdiskless.enable=" true". The controller stores the raw string and reads it withBoolean.parseBoolean, which doesn't trim. The validation inLogConfigthen reads the topic as diskless, and the controller reads it as classic.InklessMetadataView.warnIfNotBooleanalready logs that the brokers fail the requests that read the flag while the value is stored.The controller makes two wrong decisions from that value:
truelooks like a classic-to-diskless switch.markClassicToDisklessSwitchStartedmarks the partitions of a born-diskless topic as switch-pending, and the leader runs the switch on them.LogConfigHelper.wasDisklessEnabledreads the stored value asfalse, so the check "It is invalid to disable diskless" doesn't stop an alter tofalse.Example before this change
On a 3-broker cluster with consolidation on and
diskless.allow.from.classic.enable=true:1. A born-diskless topic has 5 records, and its partition has
classicToDisklessStartOffset=-1.2.
IncrementalAlterConfigssetsdiskless.enable=" true". The controller accepts it.DescribeTopicPartitionsfor the topic then fails withUNKNOWN_SERVER_ERROR.3.
IncrementalAlterConfigssetsdiskless.enable="true". The controller accepts it and starts the switch. The partition ends with a committed seal (0 in one run, 5 in another),initialDisklessLeaderEpoch=1, andclassicPrefixInRemoteStorage=true.Fix
ConfigurationControlManager.validateAlterConfigrejects a topicdiskless.enableorremote.storage.enablevalue that isn'ttrueorfalse, in any case, withINVALID_CONFIG. A create, an incremental alter, and a legacy alter all pass through that method, so a rejected request writes no records and gets no switch or consolidation markers.The check also covers
remote.storage.enable, becausemarkConsolidationStartedandwarnIfNotBooleanread it the same way. The controller therefore rejects such aremote.storage.enablevalue for a classic topic too.The check doesn't handle a value that a metadata log already stores.
Test plan
ConfigurationControlManagerTest:testRejectPaddedTopicTypeFlagandtestAcceptTopicTypeFlagInAnyCase, for both keys.ReplicationControlManagerInklessTestcovers a value with surrounding whitespace in these cases:- Followed by
trueon a born-diskless topic, through the incremental and the legacy alter. The controller writes no switch-pending marker.- Followed by
falseon a born-diskless topic, through the incremental and the legacy alter. Diskless stays enabled.- On a classic topic with the switch allowed.
- For
remote.storage.enableon a diskless topic.- At topic creation.
ConfigurationControlManager, the 9 new tests that expect a rejection fail.:metadata:checkstyleMain,:metadata:checkstyleTest, and:metadata:spotbugsMainpass.make valereports no inkless-owned prose to lint.🤖 Generated with Claude Code