← Back to Pull requests

docs(inkless): document and test the migration of untiered diskless topics #834

Closed
unknown closed this pull request without merging on Oct 23, 2026 12:42 UTC
View on GitHub
unknown unknown commented on Oct 21, 2026 14:25 UTC
Author

A diskless topic with remote.storage.enable set to false or unset has no remote tier. A cluster with consolidation off creates every diskless topic in this shape, because the controller rejects diskless.enable together with remote.storage.enable there. Enabling consolidation on the cluster doesn't consolidate these topics, and the consolidation guide didn't say how to move such a topic into consolidation.

No broker change is needed. With consolidation on, the alter of remote.storage.enable=true starts consolidation: the controller commits a leader epoch change for each partition together with the config record. This PR adds the test that pins that behavior and the procedure that relies on it.

Commits

  • test(inkless:consolidation): add untiered diskless topic tests: migration and coexistence tests.

  • docs(inkless): document untiered diskless topic migration: new section in DISKLESS_CONSOLIDATION.md, including the replication factor increase with kafka-reassign-partitions.sh, and the "Untiered Diskless Topic" glossary entry.

  • docs(inkless:docker): bound local retention in the consolidation demo: log.local.retention. in the ts-unification overlay.
  • Operator notes

  • Constraint: raise the replication factor of an RF 1 topic above 1 with a partition reassignment, before the alter. At RF 1, the metadata transformer routes clients of a consolidating partition to a hash-selected broker, which can be a broker without the partition. These clients get NOT_LEADER_OR_FOLLOWER and read nothing. A separate PR fixes this routing. After it merges, the docs can drop this constraint. Each new replica builds its local log from object storage, so the reassignment doesn't copy data between brokers.

  • The procedure is one rolling restart of brokers and dedicated controllers with the consolidation prerequisites, then one alter per topic. The migration doesn't need diskless.allow.from.classic.enable.

  • With remote storage on, the controller rejects a local retention larger than the topic retention. A topic with a retention below the broker log.local.retention. value needs a topic-level local.retention. in the same alter. The broker defaults also apply to existing classic tiered topics and to new topics, so the docs warn to give short-retention topics a topic-level value first. A diskless create with a short retention and no remote.storage.enable passes validation, and then every later alter of that topic fails. That gap exists on main and needs a separate fix.

  • The alter can't be reverted for one topic. The controller rejects remote.storage.enable=false and deleting the key while consolidation is on.

  • local.retention. has no diskless-specific default. It resolves to retention., so a migrated topic keeps its whole retention window on the local disk of every replica. The docs recommend log.local.retention.ms and log.local.retention.bytes in the broker config.

  • Topics that stay untiered keep working as diskless topics. The PG tail then covers the whole retention window, and WAL retention keeps running.
  • Testing

    InklessUntieredDisklessMigrationTest needs an untiered topic, and a cluster with consolidation on cannot create one. The test runs two clusters in sequence on the same directories, Postgres database, and object-store bucket:

    1. Cluster 1 has consolidation and tiered storage off. It is formatted, creates the diskless topic, produces 10 records, and stops. setDeleteOnClose(false) keeps the directories.
    2. Cluster 2 has consolidation and tiered storage on, without diskless.allow.from.classic.enable, and the same cluster ID. It does not call format(), so it starts as a rolling restart of cluster 1 would. The test alters remote.storage.enable=true and checks the result.

    InklessManagedReplicasRfMigrationClusterTest uses the same pattern. When the WAL start is 5, the local log must start at 5 and end at 10, and a consumer must read 5 records.

  • The migration case runs with the WAL start at 0 and at 5, advanced with DeleteRecords and with no remote segment. It checks the local log start and end, the cross-tier earliest offset, the broker-level local retention, the consumer read, the upload of the pre-migration records to remote storage after a segment roll, and the rejected revert, also with remote.log.delete.on.disable=true and as a key delete.

  • The replication factor case creates a topic with replication factor 1 on a cluster with managed replicas off. After the restart it raises the replication factor to 3 with a partition reassignment, before or after the alter. It checks that every replica reaches the end offset, including after 5 more records.

  • The routing case creates two untiered topics with replication factor 1. After the restart, one stays untiered. The other follows the procedure: replication factor 2 first, then the alter. For clients in each availability zone and for a client without one, the test checks the broker the metadata response returns and that the client reads every record. The untiered topic routes to a broker in the client zone, and the consolidating topic routes to a replica.

  • The broker replacement case uses a dedicated controller. Cluster 2 adds three new brokers with consolidation on, while the old brokers keep the old configuration. The test moves every partition, internal topics included, to the new brokers and stops the old ones. Then it runs the alter and checks consolidation, reads, and new writes on the new replicas.

  • The coexistence case keeps one topic untiered. It checks reads and writes across the restart, ListOffsets, DeleteRecords, an unrelated alter, the absence of a local log, and the topic creation rules. A topic with a retention below the broker local retention fails the alter, and passes with a topic-level local.retention.ms. It then migrates a second topic and checks that the first is unchanged.
  • Not covered by tests: topics with many partitions or high throughput, and a change of log.local.retention. under load. The docs state that turning consolidation off for a cluster is unsupported, and describe how to change the local retention without a restart.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: giuseppelillo Review duration: 2777m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #834"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    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: 29.7% · Safe to merge
    29.7%
    Repository