Repository navigation
Re-seed or refuse a start below descriptor log coverage - #323
Open
timmclaughlin wants to merge 1 commit into
Open
timmclaughlin wants to merge 1 commit into
timmclaughlin wants to merge 1 commit into
Conversation
A descriptor log seeded at one restart covers only from its seed's valid_from. Starting lower (an operator --start-lsn after a crash between bootstrap and the first manifest) makes every seeded relation's record read as NotCovered and skip undecoded. With no manifest behind the log nothing durable depends on it, so discard and re-seed at start; with one, fail and point at --ignore-cursor or re-bootstrap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
timmclaughlin
force-pushed
the
fix/bootstrap-handoff-start-lsn
branch
from
November 17, 2026 03:59
caa55f5 to
ac2f2ef
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.
Summary
This complements #284. That PR keeps the bootstrap handoff until streaming saves its manifest. This PR handles a start below what the descriptor log covers, which #284 does not change.
How we hit it: an object-store bootstrap landed at
5AA/FFDFFFF8, then crashed before the first manifest was written. The restart resumed at the source head and seeded the descriptor log there (valid_from = 5FA/6B000000). The operator then restarted with--start-lsn 5AA/FF000000. That passed every existing check, yet every record in5AA/FF..5FA/68was skipped asfirst record skipped … reason="not_covered", with no error.#284 stops the first restart from jumping to the head. This PR is still needed for any deployment that already has a log seeded too high, and for any manual
--start-lsnbelow the seed.Root cause
check_start_lsnonly compares the start withfloor_at_writeandhead. A log that has never run GC has a floor of 0, so a start below the seed passes.lookup_spannedreturnsNotCoveredfor every seeded relation, so their records skip without decoding.Fix
DescriptorLog::seed_valid_from: returns the lowestvalid_fromamong the seed batch's surviving entries. It returnsNonewhen the seed was empty or GC has dropped every seeded entry;floor_at_writebounds history in that case.open_db_desc_log, when the start is below that seed:--ignore-cursoror re-bootstrap.discard_desc_log: now shared with--ignore-cursor. NotFound is ignored; any other error now fails instead of being dropped.architecture/recovery.mdanddocs/operations.mddescribe both behaviours.Testing
desc_log::seed_valid_from_tracks_surviving_seed_entries: reopening the log, a GC that keeps one seeded relation, and a GC that drops the last one.source_dbunit tests:cargo fmt --checkandcargo clippy --workspace --all-targets -D warningspass.cargo test --libfails only the 6 tests that also fail onmainon macOS (syncfsand other Linux-only paths). The bin unit tests fail onlyhousekeeping::queued_segments_publish_highest_end, which also fails onmainon macOS._chtests need Linux and ClickHouse.🤖 Generated with Claude Code