Adding the ability to read from a parent WAL and write to a new WAL - #6
Merged
Merged
Conversation
Author
|
This change is part of the following stack: Change managed by git-spice. |
before cloning, `copy_wal_ssts` would fail with `NotFound` trying to copy WAL SSTs that no longer exist (but whose data is safely in L0). `copy_wal_ssts` now skips `NotFound` WAL SSTs at the start of the copy range (these are WALs already flushed to L0) and returns an adjusted `replay_after_wal_id` so the clone manifest doesn't reference them. Missing WALs after a successfully copied WAL still error, since that indicates actual data loss rather than post-flush cleanup.
…ed-up WAL files When a DB opens, fence_writers writes an empty WAL SST that advances next_wal_sst_id but not replay_after_wal_id, leaving a gap of 1. After a full flush the memtable is empty, so flush_memtables never freezes or flushes anything, and replay_after_wal_id stays behind. If the WAL store is later cleaned up externally (e.g. local disk wiped after a shard split), a clone created from this checkpoint tries to copy the missing fencing WAL and crashes with NotFound. Fix: after CheckpointScope::All flushes complete, advance replay_after_wal_id to next_wal_sst_id - 1. All data is already in L0 at that point, so the remaining WAL SSTs are redundant.
udnay
force-pushed
the
yo/add-read-only-wal-write-wal
branch
from
April 6, 2026 21:28
fc41306 to
fcc8a7e
Compare
udnay
added a commit
that referenced
this pull request
Apr 7, 2026
Adding the ability to read from a parent WAL and write to a new WAL
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.
Adding the ability to read from a parent WAL and write to a new WAL
Adding the ability to read from a parent WAL and write to a new WAL
Summary
What is being changed and why?
Changes
Notes for Reviewers
Any hints on how to best review this PR? Anything you’d like reviewers to focus on? Any follow-ups planned?
Checklist
cargo fmt,cargo clippy --all-targets --all-features, andcargo nextest run --all-featuresThank you for the review! 🙏