Repository navigation
Merge main into v3 (#445, #447 fixes) - #450
Merged
Merged
Conversation
Each pending fact was indexed with FactRef { page_id: 0, slot_index }, where
slot_index is its position in the pending list. The position was a
saturating u16, so every fact from position 65,535 on shared one slot and
entity lookups and attribute scans silently lost or duplicated facts. This
affected in-memory databases and file databases before a checkpoint.
slot_index is now a u32, and pending positions are checked rather than
saturated. postcard writes u16 and u32 as the same varint, so v7 index pages
are byte-for-byte unchanged; a test pins this.
Refs #445
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
…erflow fix(storage): index pending facts past 65,535 correctly (#445)
Open sets the transaction counter from the file's checkpointed count, then WAL replay skips entries at or below it and calls restore_tx_counter, which stored the highest tx_count among the facts it had loaded. When every WAL entry was already checkpointed, nothing was loaded and the counter was reset to 0, so later transactions reused tx_counts already in the file and :as-of history was wrong, permanently after the next checkpoint. restore_tx_counter now only raises the counter (fetch_max). Refs #447 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
fix(storage): never rewind the tx counter on WAL replay (#447)
Storage code keeps v3's side: FactRef and fact pages are gone on v3, and v3 already carries the #447 fix. main's #445 behaviour tests are kept (FactStorage unit test and the edge_cases_test.rs tests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Merges
mainintov3with a merge commit.v3's side:FactRefand fact pages no longer exist on v3, and the Transaction counter rewinds after reopening next to an already-checkpointed WAL #447 fix is already there from feat(storage): v8 covering keys, DICT and value pages (PR 3 of 5) #449.main's Queries return wrong results with more than 65,535 uncheckpointed facts #445 behaviour tests are kept: theFactStorageunit test and theedge_cases_test.rstests.v3's text, plus a CHANGELOG line and a TEST_COVERAGE note for Queries return wrong results with more than 65,535 uncheckpointed facts #445.Local result: 1,218 passing, 8 ignored.
cargo clippy --all-features -- -D warningsis clean.🤖 Generated with Claude Code
https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn