Sealed watermark for concurrent reconciliation#77
Merged
Conversation
Track the highest SegmentIndex whose manifest update has been confirmed durable for a sealed (no longer active) segment. This high-water mark lets reconciliation distinguish an active tail segment (writer noise, never a real mismatch) from a sealed, immutable segment. The watermark is sourced from the existing manifest-durability signal: the slog now reports whether a write sealed its segment, and the partition's commit task advances an AtomicU64 right after the durable manifest update lands. It is monotonically non-decreasing, so retention removing old segments never moves it backward. The currently active (writeable) segment is never included. Co-Authored-By: Claude <noreply@anthropic.com>
Replace the AtomicU64 with an `index + 1` sentinel encoding with a watch::channel<Option<SegmentIndex>>. This removes the error-prone implicit index arithmetic: the watermark is now a real Option, advanced monotonically in the commit task and read lock-free via borrow(). Co-Authored-By: Claude <noreply@anthropic.com>
JONBRWN
approved these changes
Jun 3, 2026
imp
approved these changes
Jun 4, 2026
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.
With this in place, we can limit reconciliation to segments that should be completely settled in the manifest. This is one of the (if not the) major current possible sources of drift.