← Back to Pull requests

fix(inkless:controller): reject a topic type flag that isn't true or false #899

Closed
unknown closed this pull request without merging on Nov 25, 2026 15:00 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 11:29 UTC
Author

A diskless.enable value 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

ConfigDef trims a boolean before it parses it, so a create or an alter accepts diskless.enable=" true". The controller stores the raw string and reads it with Boolean.parseBoolean, which doesn't trim. The validation in LogConfig then reads the topic as diskless, and the controller reads it as classic. InklessMetadataView.warnIfNotBoolean already 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:

  • An alter that corrects the value to true looks like a classic-to-diskless switch. markClassicToDisklessSwitchStarted marks the partitions of a born-diskless topic as switch-pending, and the leader runs the switch on them.

  • LogConfigHelper.wasDisklessEnabled reads the stored value as false, so the check "It is invalid to disable diskless" doesn't stop an alter to false.
  • 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. IncrementalAlterConfigs sets diskless.enable=" true". The controller accepts it. DescribeTopicPartitions for the topic then fails with UNKNOWN_SERVER_ERROR.
    3. IncrementalAlterConfigs sets diskless.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, and classicPrefixInRemoteStorage=true.

    Fix

    ConfigurationControlManager.validateAlterConfig rejects a topic diskless.enable or remote.storage.enable value that isn't true or false, in any case, with INVALID_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, because markConsolidationStarted and warnIfNotBoolean read it the same way. The controller therefore rejects such a remote.storage.enable value for a classic topic too.

    The check doesn't handle a value that a metadata log already stores.

    Test plan

  • ConfigurationControlManagerTest: testRejectPaddedTopicTypeFlag and testAcceptTopicTypeFlagInAnyCase, for both keys.

  • ReplicationControlManagerInklessTest covers a value with surrounding whitespace in these cases:

  • - Followed by true on a born-diskless topic, through the incremental and the legacy alter. The controller writes no switch-pending marker.
    - Followed by false on 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.enable on a diskless topic.
    - At topic creation.
  • Both classes pass with the change: 284 tests. Without the change to ConfigurationControlManager, the 9 new tests that expect a rejection fail.

  • :metadata:checkstyleMain, :metadata:checkstyleTest, and :metadata:spotbugsMain pass.

  • make vale reports no inkless-owned prose to lint.
  • 🤖 Generated with Claude Code

    Diff: 424 lines (+318 / -106) across 5 files Reviewer: giuseppelillo Review duration: 210m
    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
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.1% (MEDIUM) · Higher = larger blast radius
    45.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.8% · Safe to merge
    17.8%
    Repository