Repository navigation
feat(sync): apply in pages, one frame and one rebase each (T13193 R-4c) - #1923
Merged
Merged
Conversation
…c, T13274) Journal spec §3.5 Rule 3 (R6-4): - staged txns apply in pages (REBASE_PAGE_OPS 2000 / REBASE_PAGE_MS 50, overridable): one apply frame, one rewind, each txn in its own Gate C savepoint, one replay. Pages break between txns only, on an actor change, and an oversize txn is a page alone. - a rewound local txn whose echo is in the page is decided at its stream position; the rest are replayed at page end; the fast path is judged once per page (planPageRebase). - a natural twin insert is rewound to the stream's row, not deleted (D2). - T13274: a U setting part of a composite UNIQUE key fills the rest from the current row for its pseudo-row. - nit from #1922: comment why adoptNaturalRow checks === 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
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.
Task: T13193
Second part of the fourth slice of the scoped rebase (journal spec §3.5 Rule 3, R6-4). Stacked on #1922 (T13273). Also closes T13274, #1921's LOW.
What changes
applyStagedTxnsnow groups staged txns into pages withtakePage: up toREBASE_PAGE_OPS(2,000) ops, withpageOps/pageMsoverrides.REBASE_PAGE_MS, 50 ms) stops a page from taking more txns; whatever is left starts the next page.planPageRebasebuilds the scope over the page's foreign footprints and its own echoes that fail the fast path, to a fixed point;applyInPageruns per txn: pre-checks, planning, clock, ops in their own Gate C savepoint, post-apply checks, sequencing, inbox mark;planOwnRebase, which leaves out what the page already rewound).echoInPlacereuses the page'sunsequencedLocalTxns, and the verdict is reused at sequencing. That covers review-hotfix's O(backlog) LOW from feat(sync): scoped rebase frame - rewind, apply, replay (T13193 R-2) #1916.adoptNaturalRow's=== 1.Tests
pageOps: 1) converges with one page, checked throughapplied_frame;pageOps: 1applies whole.rebased: 2(B's insert and A's echo share one rebased page);Locally green:
--base origin/fix/T13273-natural-key-apply) and 40.Not here: the R6-4 7-day backlog benchmark on a cleocode scratch copy (heavy; waiting on team-lead's call on a separate task).
🤖 Generated with Claude Code