Repository navigation
refactor(inkless:switch): remove the seal and repair operator commands 8000 - #872
Draft
giuseppelillo wants to merge 2 commits into
Draft
giuseppelillo wants to merge 2 commits into
giuseppelillo wants to merge 2 commits into
Conversation
The `seal` and `repair` commands of `kafka-topic-switch.sh` wrote switch state directly: `seal` set an arbitrary seal offset or aborted with `-1`, and `repair` rewrote the control plane's diskless log. Each command had to stay consistent with the broker, the controller, and the control plane at once, and KC-746 and KC-717 show they often didn't. The switch isn't in production yet, so removing them now costs no operator workflow. The tool keeps two commands: - `state`: Prints the switch fields of each partition. It's read-only. - `rearm`: Sends `AlterDisklessSwitch` with `-2`. The controller accepts it only while the switch is pending, and bumps the leader epoch so the leader seals again and re-runs `InitDisklessLog`. The controller now rejects any other seal offset and `ClearProducerStates`. The `AlterDisklessSwitch` wire schema and the `Admin` signature don't change, so a mismatched CLI and controller don't misparse each other. This change removes the `RepairDisklessLog` RPC, its admin, broker, and control plane code, and its metrics. Migration `V32` drops the `repair_diskless_log_v1` function and types, and the jOOQ code is regenerated. Assisted-by: Claude Opus 5.5
…essSwitch After the seal and repair commands went away, `AlterDisklessSwitch` kept a `SealOffset` field that accepted only `-2` and a `ClearProducerStates` field that the controller always rejected. Both fields existed only to be validated. `RearmDisklessSwitch` (API key 501) carries only the topic and the partition, and `Admin.rearmDisklessSwitch` drops its `sealOffset` parameter. The controller re-arms the switch only while it's pending, as before. This change breaks wire compatibility with `AlterDisklessSwitch`; nobody has used that RPC. Assisted-by: Claude Opus 5.5
giuseppelillo
marked this pull request as draft
November 13, 2026 15:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
sealandrepaircommands ofkafka-topic-switch.shwrote switch state directly.sealset an arbitrary seal offset or aborted the switch with-1, andrepairrewrote the control plane's diskless log. Each command had to stay consistent with the broker, the controller, and the control plane at once. KC-746 and KC-717 show they often didn't. The switch isn't in production yet, so removing them now costs no operator workflow.What remains
The tool keeps two commands:
state: Prints the switch fields of each partition. It's read-only.rearm: Sends the newRearmDisklessSwitchRPC, which contains only the topic and the partition. The controller accepts it only while the switch is pending. It bumps the leader epoch, so the leader seals again and re-runsInitDisklessLog.What reviewers should know
RearmDisklessSwitchreplacesAlterDisklessSwitchon API key 501, andAdmin.rearmDisklessSwitch(topic, partition)replacesAdmin.alterDisklessSwitch. The oldSealOffsetandClearProducerStatesfields are gone. This breaks wire compatibility on purpose: nobody has usedAlterDisklessSwitch.RepairDisklessLogRPC, its API key, and its admin, broker, and control plane code are gone, along with its metrics.V32__Remove_repair_diskless_log.sqldropsrepair_diskless_log_v1and its types. Earlier migrations stay untouched because databases have already applied them. The jOOQ code is regenerated, and most of that diff is the schema version bump.state.Test plan
make vale, compile, and checkstyle are clean.tools,metadata,clients,storage:inkless, andcore(ReplicaManagerInklessTestandRequestQuotaTest).InklessTopicTypeSwitcherClusterTestpasses 6 of 6. The newtestRearmDisklessSwitchRejectsCommittedSwitchswitches a topic, waits for the seal to commit, then checks that the controller rejects a re-arm and keeps the seal.🤖 Generated with Claude Code