8000 docs(inkless:switch): document how to move local logs past the old seal after lower-seal [KC-837] by giuseppelillo · Pull Request #889 · aiven/inkless · GitHub
[go: up one dir, main page]

Skip to content

docs(inkless:switch): document how to move local logs past the old seal after lower-seal [KC-837] - #889

Merged
giuseppelillo merged 3 commits into
mainfrom
claude/kc-837-lowered-seal-docs
Nov 23, 2026
Merged

giuseppelillo merged 3 commits into
mainfrom
claude/kc-837-lowered-seal-docs

Conversation

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

lower-seal moves the committed seal below the offset where the diskless log starts. Consolidation appends the diskless records at the old seal, so each replica's leader epoch cache maps the lost offsets to a classic epoch. While a replica holds local segments below the old seal, a broker restart or a leader change makes replicas truncate or recreate their consolidated records, and a follower can stop consolidating.

lower-seal only follows a last-known-leader election in phase 1 that lost records, so this PR documents a manual procedure and doesn't change the broker. It adds the subsection "Move the local logs past the old seal" to CLASSIC_TO_DISKLESS_SWITCH.md and links it from the recovery steps of the last-known-leader election. This PR replaces #884, which fixed the truncation check in code.

Test plan

The procedure comes from a cluster test that isn't part of this PR. It extends ClassicToDisklessSwitchLastKnownLeaderClusterTest at e3c990ecdb: three brokers, a lowered seal 15 with the old seal 20, and phase 2.

  • The broker message that marks the partition offline reads has LEO 15 below the classic-to-diskless seal 20, which gives the old seal before lower-seal replaces it.
  • Without the procedure, one leader change recreates all three replicas, and a follower stays at log end offset 15 with a failed consolidation fetcher.
  • With segment.ms and local.retention.ms at 1000, every replica's local log start passes the old seal: in 16 seconds with a 1-second log.retention.check.interval.ms, in 43 seconds with a 40-second one, and with no traffic.
  • After that, two leader changes and a follower restart cause no truncation, no recreation, and no failed fetcher, and a consumer reads every record from offset 0. This holds in six cases: retention first, retention on an idle topic, the 40-second check, a leader change during retention, a leader change before retention, and a follower restart before retention. A seventh case, a leader change after consolidated segments reach remote storage, ends with two clean leader changes and complete consumes, without the follower restart.
  • In the three cases with a restart or leader change before retention, followers stay at the new seal through 120 seconds of forced retention in two cases and 60 seconds in the third. A restart of the leader resumes them without a recreation. That is step 3.
  • In every case, the lowest .log base offset in each replica's partition directory equals that replica's local log start offset. That is the check in step 2.
  • Every run had diskless records past the old seal. The statement about a partition without one comes from the code: divergenceFromCommittedHistory and shouldTruncateSwitchedPartitionToSeal in ReplicaManager act only when the log ends past the seal.
  • make vale reports no alerts.

🤖 Generated with Claude Code

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The recovery procedure can indefinitely block stalled-replica recovery, fails to capture the old seal before it changes, and risks deleting pre-existing retention settings.

3 open issues
What changed in this PR

This documentation-only PR adds a manual recovery procedure for local logs after lower-seal, replacing the broker-code approach in #884.

Changes:

  • Link last-known-leader recovery to the new local-log procedure.
  • Document temporary retention settings, replica checks, and restart guidance to move local logs past the old seal.
File Description
docs/​inkless/​CLASSIC_TO_DISKLESS_SWITCH.md Add and link the post-lower-seal local-log recovery procedure.

Review effort: Balanced

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documented procedure can stall indefinitely if no diskless records have arrived, without explaining this prerequisite, how to defer until application traffic supplies one, or which restrictions remain in effect while waiting.

1 open issue
3 resolved since last review

Review effort: Balanced

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The recovery runbook relies on cluster-test extensions absent from the PR, so a maintainer should validate the retention and stalled-follower restart procedures before operators rely on it.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@giuseppelillo
giuseppelillo requested a review from jeqo November 23, 2026 09:32
…al after lower-seal [KC-837]

`lower-seal` moves the committed seal below the offset where the
diskless log starts. Consolidation appends the diskless records at the
old seal, so each replica's leader epoch cache maps the lost offsets to
a classic epoch. While a replica holds local segments below the old
seal, a broker restart or a leader change makes replicas truncate or
recreate their consolidated records, and a follower can stop
consolidating.

`lower-seal` only follows a last-known-leader election in phase 1 that
lost records, so this change documents a manual procedure and doesn't
change the broker. The procedure forces local retention past the old
seal, after which restarts and leader changes leave the replicas alone.

Assisted-by: Claude Fable 5.2
…ered-seal procedure [KC-837]

The procedure asked for the old seal after `lower-seal` replaced it, so
the recovery steps now take it from the broker message that marks the
partition offline. A replica that stopped consolidating can't pass the
segment check, so the leader restart no longer waits for it. The last
step restores the topic configs to their previous values.

Assisted-by: Claude Fable 5.2
…iskless record [KC-837]

Without a diskless record, every local log ends at the new seal, so no
segment can start past the old seal and the wait in step 2 never ends.
The broker also has nothing to truncate in that state. The procedure
now starts after the first diskless record, and the restart restriction
applies from that record on.

Assisted-by: Claude Fable 5.2
@giuseppelillo
giuseppelillo force-pushed the claude/kc-837-lowered-seal-docs branch from afe7fdc to e57294b Compare November 23, 2026 10:20
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.

3 participants

0