Repository navigation
fix(inkless:consolidation): cap the WAL prune at the end of remote storage - #868
Draft
giuseppelillo wants to merge 1 commit into
Draft
giuseppelillo wants to merge 1 commit into
giuseppelillo wants to merge 1 commit into
Conversation
…orage After an operator lowers a committed seal with `kafka-topic-switch.sh seal`, the WAL has no batches between the end of remote storage and the first diskless batch. The prune takes the base offset of the first retained batch as the new WAL start, so it moves the WAL start past that range. A replica that rebuilds from remote storage resumes at the end of remote storage, fetches below the WAL start, and can't make progress. The keep-offset now never passes `highestOffsetInRemoteStorage + 1`. The WAL start stays at the end of remote storage, and a read in the empty range returns the first diskless batch. `V32` replaces `prune_batches_below_highest_tiered_offset_v2` with the capped version, and `InMemoryControlPlane` applies the same cap. Assisted-by: Claude Fable 5.2
giuseppelillo
marked this pull request as draft
November 13, 2026 13:56
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.
After an operator lowers a committed seal with
kafka-topic-switch.sh seal, the WAL has no batches between the end of remote storage and the first diskless batch. The prune takes the base offset of the first retained batch as the new WAL start, so it moves the WAL start past that range. A replica that rebuilds from remote storage resumes at the end of remote storage, fetches below the WAL start, and can't make progress.The keep-offset now never passes
highestOffsetInRemoteStorage + 1. The WAL start stays at the end of remote storage, and a read in the empty range returns the first diskless batch.V32__Cap_prune_at_remote_end.sqlreplacesprune_batches_below_highest_tiered_offset_v2with the capped version.InMemoryControlPlaneapplies the same cap.This change is a prerequisite for the phase 1 recovery work in PR #855 (KC-717).
Test plan
handoffBelowLostRangeKeepsWalStartAtRemoteEndinAbstractControlPlaneTestprunes a switched log whose remote storage ends below the seal. It checks that the WAL start stays at the end of remote storage, that a read in the empty range returns the first diskless batch, and that a later prune past the seal still deletes that batch. The test runs inInMemoryControlPlaneTestandPostgresControlPlaneTest, and fails without the cap.🤖 Generated with Claude Code