Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
citizen-stig
force-pushed
the
nikolai/rollback-delta-during-merkle-update
branch
from
October 26, 2026 13:34
fc91b25 to
47296c8
Compare
citizen-stig
marked this pull request as ready for review
October 26, 2026 15:26
rphmeier
approved these changes
Oct 26, 2026
1 of 2 tasks
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 rollback enabled,
Session::finishcallsReverseDeltaBuilder::finalizebefore it starts the merkle update.finalizewaits for the speculative prior-value loads and fetches the priors of any written keys that weren't preserved in advance. All of that happens before any merkle work begins.Changes
finalizenow runs afterupdate_and_provehas been kicked off, so the delta is built while the merkle workers run.This is safe because both sides only read: the merkle update reads pages and leaves, and the delta worker reads values through its own beatree read transaction (
rollback/reverse_delta_worker.rs). The store isn't modified until theFinishedSessionis committed, and a sync waits for open read transactions. The resulting delta is the same.Unrelated to #947, which moves where the delta is persisted (inside the store sync). This PR changes when it is built (during
Session::finish).Touches the same lines of
Session::finishas #951. Whichever lands second needs a trivial rebase.Performance impact
after benchmarking from #944 (rollback enabled, e.g.
NOMT_BENCH_ROLLBACK=<len>).With rollback enabled (NOMT_BENCH_ROLLBACK=100, transfer workload, 16 paired rounds on a dedicated NVMe), Session::finish drops from 92.1 ms to 71.4 ms (−22.6%), mean block time drops by 11.2%, and throughput rises by 13% (63.7k → 72.5k ops/s). With an overlay window of 4, the gains are similar: finish −26.8% and block time −12.9%. This removes almost all of rollback's cost from finish, which now matches the rollback-disabled time of 73.5 ms. With rollback disabled the change is a no-op, and the durable commit time is unaffected.
Combined with #947 (rollback delta persisted inside the store sync), the durable commit also drops by 13.6%, so mean block time falls by 17.6% and throughput rises by 21.7% (63.9k → 75.8k ops/s) compared with master.