Skip to content

Sealed watermark for concurrent reconciliation#77

Merged
AnIrishDuck merged 2 commits into
mainfrom
fmurphy/claude/sealed-watermark
Jun 4, 2026
Merged

Sealed watermark for concurrent reconciliation#77
AnIrishDuck merged 2 commits into
mainfrom
fmurphy/claude/sealed-watermark

Conversation

@AnIrishDuck

Copy link
Copy Markdown
Collaborator

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.

claude added 2 commits June 2, 2026 22:12
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>
@AnIrishDuck AnIrishDuck requested review from JONBRWN and imp June 3, 2026 21:29
@AnIrishDuck AnIrishDuck merged commit dca428a into main Jun 4, 2026
2 of 3 checks passed
@AnIrishDuck AnIrishDuck deleted the fmurphy/claude/sealed-watermark branch June 4, 2026 15:29
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.

4 participants