Repository navigation
fix(compaction): Keep the background mark and result on the current history - #2611
Merged
thomasjiangcy merged 1 commit intoNov 3, 2026
Merged
Conversation
…istory The mark used projection seqs, and messages kept by a replacement carry the seqs of their older source events. The job reads events up to the mark, so it could stop before the replacement and summarize too little. The mark now does not fall before the replacement event. The job also checks the History version again before it writes the result, so a replacement during the summary call drops the result.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
thomasjiangcy
approved these changes
Nov 3, 2026
thomasjiangcy
deleted the
fix/background-compaction-mark-after-replacement
branch
November 3, 2026 14:53
This branch was successfully deployed
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.
Fixes two Cursor Bugbot findings from #2606 that landed on main. They were reported on its last head (
28dc7cbd3), and the PR merged before the fix was pushed.Mark after a replacement (high). The request took
markSeqfrom the projection seqs. Messages kept by acompactionorhandoffreplacement carry the seqs of their older source events. The job projects withmaxSeq: markSeq, so it could stop before the replacement event and summarize empty or truncated history. The mark now does not fall before the replacement event. The swap still finds the cut correctly: kept messages have seqs below the mark, and later native events have seqs above it.Result after a replacement during the job (medium). The job checked the History version only before the summary call. A replacement during the call let it append a
compaction_preparedevent for the old version into the new current history. The job now checks the version again before it writes and returnsstaleon a mismatch. A replacement between that check and the append is still possible, but the swap and the request check both matchhistoryVersion, so that event is never used. No schema or event store API change.Both new integration cases in
background-compaction-events.test.tsfail without the fix.via @thomasjiangcy.
--
View Session [Sentry]