fix: compact fragmented unsized index pages - #43
Merged
Conversation
pathscale
force-pushed
the
fix/unsized-index-fragmentation
branch
from
August 4, 2026 02:33
2918587 to
31ade5f
Compare
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 variable-width index corruption after delete fragmentation, restart, and further inserts. Unsized pages grow a slot directory from the front and values from the tail; after reload, physical delete fragmentation was absent from the in-memory split estimate and the regions could overlap. The fix counts slot and node-id replacement bytes, compacts fragmented pages before persistence, and covers both single-event and batch write paths. The regression reproduces 211 inserts, 37 deletes, a restart, and 20 inserts; it now also asserts persisted utility size plus tail offset never exceeds page capacity. Released beta.2 fails with InvalidSubtreePointer; this branch reopens and reads all 194 live rows. Persistence errors are terminal as of 4f1e4d2 and are returned by wait_for_ops. Verification: cargo fmt, cargo clippy --all-targets with warnings denied, targeted regression, and all 51 unsized tests. Current master CI already has tracked follow-up failures outside these paths.