This repository was archived by the owner on Sep 29, 2026. It is now read-only.
Repository navigation
Install a leaf page only after its WAL record is appended. - #117
Merged
Merged
Conversation
A non-splitting insert stages the new page off the live frame, appends IndexInsert, then swaps that page in and sets its LSN while holding the frame lock. A crash at index::insert therefore leaves the leaf without the key, and a flush cannot persist the new bytes under the previous LSN. Splits and durability mode are unchanged. Claim: AGENT_CHAT.md 2026-09-25T01:20Z fix/index-wal-before-page. Acceptance: cargo test -p redlinedb-bench --offline --test index_insert_publish; cargo test -p redlinedb-kernel --offline --lib direct_insert_matches direct_unique_conflict; cargo test -p redlinedb-kernel --offline --test index_tests
neverhumanbot
approved these changes
Sep 25, 2026
neverhumanbot
left a comment
Owner
There was a problem hiding this comment.
Leaf install happens after the IndexInsert WAL record, under one frame lock. A crash at index::insert leaves the key off the leaf. Required, audit, official parity, evidence guard, and packaging succeeded on 398649a.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
A non-splitting leaf insert no longer edits the live page before its WAL record exists. The new page is staged privately.
index::insertstill fires before the record is appended, and a crash there leaves the leaf without the key. After the append, the staged page and its LSN are installed under one frame lock, so a flush cannot write the new bytes with the previous LSN. Splits are unchanged. Durability stays Strict.Claim:
AGENT_CHAT.md2026-09-25T01:20Zfix/index-wal-before-page.Acceptance:
cargo test -p redlinedb-bench --offline --test index_insert_publish;cargo test -p redlinedb-kernel --offline --lib direct_insert_matches direct_unique_conflict;cargo test -p redlinedb-kernel --offline --test index_tests. Localjust pr-ciexited 0 (/tmp/redline-pr-ci-walpage.log).Parent:
28196cdf31eebc1f466920aa0f2b6200d85e8720.