Repository navigation
feat(storage): v8 copy-on-write checkpoints (PR 4 of 5) - #451
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
#434) PageAllocator reads the active meta's free-list chain one page at a time as it needs ids, and finish_free_list pushes freed pages, read chain pages and unused ids as new head pages in front of the unread tail. cow_insert rewrites only the touched leaves and their paths to the root, splitting leaves and internal nodes by balanced bytes and growing the root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
save() inserts into each of the five trees copy-on-write and pushes the replaced pages and the free-list pages it read onto the free list, read lazily from the active meta. A checkpoint no longer snapshots or copies the old trees. rebuild_btree_incremental is removed; collect_leaf_pages stays for the reachability test helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
…ts (#434) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
…rage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Oct 6, 2026
Closed
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.
Summary
PR 4 of 5 of the v8 storage format: copy-on-write checkpoints (spec §4.4, §8; plan section "PR 4"). A checkpoint now writes only:
Its cost follows the change, not the graph (#434 acceptance 1, 2, 4). The file format is unchanged.
checkpoint/after_1_factPages written by a checkpoint (from the cost-bound test):
What changed
PageAllocator::from_chain,finish_free_list).allocreads the active meta's free-list pages one at a time, only when it needs another id. That is why its signature now takes the backend and the cache.btree::cow_insert.freed.save()uses both and no longer snapshots the old trees.rebuild_btree_incrementaland its tests, along withleaf_first_keyandleaf_last_key.collect_leaf_pagesandvalidate_leaf, for the reachability helpers and later for Add index integrity check (verify) and public rebuild-indexes-from-fact-pages #373's verify.FactStorageread guard for its whole scan, and installing the new reader needs the write lock. So no query spans two checkpoints, and the page cache stays write-through.BrowserBufferBackendalready tracks dirty pages per write, so its flush is now O(change) too. No code change.Tests
cow_insert, against a sorted merge, for random batches, keys below the first and above the last, many into one leaf, root growth to depth 3, and 1 KB separators:freedis exactly the replaced nodes;concurrency_test): four readers query throughout 40 checkpoints. No read fails, and the fact count never goes backwards.cargo clippy --all-features -- -D warningsis clean.Docs
CHANGELOG, the
Minigraf::checkpointandwal_checkpoint_thresholdrustdoc (no longer "proportional to the total index size"), CLAUDE.md, TEST_COVERAGE, and the plan's PR 4 section. The 1M-fact benchmarks andafter_100k_factsmove to PR 5.Refs #434 #374
🤖 Generated with Claude Code
https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn