fix(marten#4953): CheckNowAsync targets the committed ceiling, time-bounded#530
Merged
Merged
Conversation
…d (2.29.1) CheckNowAsync — driven with no staleness gating by projection rebuilds, PrepareForRebuildsAsync, and daemon catch-up — looped DetectInSafeZone until the high water mark reached HighWaterStatistics.HighestSequence. That value can be a database sequence's last_value, which includes numbers merely RESERVED by in-flight or rolled-back transactions, so the loop either pressured safe-zone detection into skipping over in-flight appends (a rebuild or catch-up during an import silently lost their events once they committed) or could spin forever on a rolled-back tail. - New IHighWaterDetector.FetchCommittedHighWaterCeilingAsync DIM: the highest COMMITTED sequence. Default preserves prior behavior (Detect().HighestSequence) so existing detectors are unchanged; Marten overrides with max(seq_id). - CheckNowAsync loops to that committed ceiling — reachable by definition — so a detector that holds before in-flight gaps (Marten's #4953 transaction- evidence gating) simply makes the loop WAIT for the appends to land. - The loop is time-bounded (CheckNowTimeout, default 5 minutes) and logs a warning when it proceeds without reaching the ceiling. Three new HighWaterAgent tests; existing daemon suite green on net9/net10. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 18, 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.
Half of the fix for marten discussion #4953 (silent async-daemon event skips under concurrent appends); the Marten-side transaction-evidence gating rides in the companion Marten PR.
CheckNowAsync— driven with no staleness gating by projection rebuilds,PrepareForRebuildsAsync, and daemon catch-up — loopedDetectInSafeZoneuntil the mark reachedHighWaterStatistics.HighestSequence. That value can be a database sequence'slast_value, which includes numbers merely reserved by in-flight or rolled-back transactions, so the loop either pressured safe-zone detection into skipping over in-flight appends (rebuild/catch-up during an import silently lost their events) or could spin forever on a rolled-back tail.IHighWaterDetector.FetchCommittedHighWaterCeilingAsyncDIM (default preserves prior behavior; Marten overrides withmax(seq_id))CheckNowAsyncloops to the committed ceiling — reachable by definition — so a detector that holds before in-flight gaps makes the loop wait for the appends to land instead of skipping themCheckNowTimeout, default 5 min) with a warning when it proceeds earlyBumps version to 2.29.1 for an incremental publish.
🤖 Generated with Claude Code