Repository navigation
overlay: add Overlay::commit_batch - #948
Draft
citizen-stig wants to merge 4 commits into
Draft
citizen-stig wants to merge 4 commits into
citizen-stig wants to merge 4 commits into
Conversation
Overlay::commit cloned every page and value change before writing them out. Validate the parent marker and root under the write lock, mark the overlay committed, then move the changes out. Data is only cloned if a live overlay still holds it. Validating before marking also stops a rejected commit from leaving the overlay marked as committed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rollback delta used to be appended and fsynced before the store commit started. Pass it into Store::commit instead and append it while bitbox and beatree prepare their writes. All three are joined before the manifest is written, so the delta is still durable before the manifest references it. After the manifest, finish the beatree sync on its thread pool while bitbox writes the hash-table pages. FinishedSession::try_commit_nonblocking no longer needs Rollback::commit_nonblocking: the rollback log is only touched under the store's sync lock now, so it is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commit a chain of overlays with one durable write instead of one per overlay. Page changes are merged in order: a page deleted and recreated within the chain is rewritten in full into its original bucket, and a page created and deleted within the chain is dropped. Value changes are staged oldest first, so the last change of a key wins. Each overlay keeps its own rollback delta. Rollback::commit now takes several deltas and appends them with one fsync, and the writeout prunes as many deltas as needed. The manifest records the live range after pruning, so reopening does not bring expired deltas back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wb3qFhAoTArSEcSTGVDCu
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.
Adds
Overlay::commit_batch(overlays, &nomt), which commits a chain of consecutive overlays with one durable write instead of one per overlay.API
Overlay::commit.Merging
Rollback
Nomt::rollback(n)steps through the chain the same way as after sequential commits.Rollback::committakes several deltas.SegmentedLog::append_batchwrites them with a single fsync (the old head segment is fsynced first if the batch rotates segments).max_rollback_log_len. Before, it pruned at most one.rollback_start_live). Before, it recorded the range before pruning, so a reopen could see more thanmax_rollback_log_lendeltas.rollback_writeout_start_and_endis updated accordingly (1 → 2, 2 → 3).Tests
New
nomt/tests/commit_batch.rs:commit_batch_matches_sequential_commits: same values, roots and bucket occupancy as committing one by one, before and after a reopen. The workload is checked to really clear and recreate stored pages.commit_batch_rollback_matches_sequential_commits: rollback of 1..=N steps matches sequential commits, before and after a reopen.commit_batch_rollback_log_shorter_than_chain: a chain longer than the rollback log.commit_batch_rejects_invalid_chain: an invalid chain is rejected and nothing is committed.Results
TODO:
benchtopdoes not callcommit_batchyet. A batch vs sequentialdurable_commitcomparison is needed.