8000 refactor(inkless:switch): remove the seal and repair operator commands by giuseppelillo · Pull Request #872 · aiven/inkless · GitHub
[go: up one dir, main page]

Skip to content

refactor(inkless:switch): remove the seal and repair operator commands 8000 - #872

Draft
giuseppelillo wants to merge 2 commits into
mainfrom
claude/classic-diskless-switch-tooling-f604b8
Draft

giuseppelillo wants to merge 2 commits into
mainfrom
claude/classic-diskless-switch-tooling-f604b8

Conversation

@giuseppelillo
@giuseppelillo giuseppelillo commented Nov 13, 2026 •
Copy link
Copy Markdown
Contributor

The seal and repair commands of kafka-topic-switch.sh wrote switch state directly. seal set an arbitrary seal offset or aborted the switch 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. 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 new RearmDisklessSwitch RPC, 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-runs InitDisklessLog.

What reviewers should know

  • RearmDisklessSwitch replaces AlterDisklessSwitch on API key 501, and Admin.rearmDisklessSwitch(topic, partition) replaces Admin.alterDisklessSwitch. The old SealOffset and ClearProducerStates fields are gone. This breaks wire compatibility on purpose: nobody has used AlterDisklessSwitch.
  • The RepairDisklessLog RPC, its API key, and its admin, broker, and control plane code are gone, along with its metrics.
  • Migration V32__Remove_repair_diskless_log.sql drops repair_diskless_log_v1 and 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.
  • The broker's handling of a re-seal in phase 1 is now unreachable from the tool. This PR leaves it in place.
  • KC-749, KC-751, KC-754, and KC-755 target the removed commands. KC-756 still applies to state.

Test plan

  • make vale, compile, and checkstyle are clean.
  • Unit tests pass in tools, metadata, clients, storage:inkless, and core (ReplicaManagerInklessTest and RequestQuotaTest).
  • InklessTopicTypeSwitcherClusterTest passes 6 of 6. The new testRearmDisklessSwitchRejectsCommittedSwitch switches 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

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
giuseppelillo marked this pull request as draft November 13, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0