fix: avoid panic when rebasing a commit whose read version was cleaned up - #8935
Merged
zhangyue19921010 merged 1 commit intoSep 2, 2026
Merged
Conversation
…d up initial_fragments_for_rebase unwrapped checkout_version(read_version). If a concurrent cleanup_old_versions removed that version between the conflicting commit and the rebase, the unwrap panicked on DatasetNotFound, aborting the whole process when built with panic="abort". Propagate the error instead so the commit fails gracefully and can be retried. Adds a regression test that deletes the read version's manifest and asserts the rebase returns DatasetNotFound instead of panicking.
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The rebase now propagates the existing DatasetNotFound contract from the authoritative historical checkout instead of panicking, with no durable write performed before the failure. The regression coverage exercises the cleaned-up-manifest path while preserving the surrounding conflict-resolution behavior.
zhangyue19921010
approved these changes
Sep 2, 2026
zhangyue19921010
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Thanks for your contribution!
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.
Problem
When two transactions commit concurrently and one of them needs to be rebased,
initial_fragments_for_rebasecallscheckout_version(transaction.read_version)and
.unwrap()s the result:dataset .checkout_version(transaction.read_version) .await .unwrap(),If a concurrent cleanup_old_versions (e.g. triggered by VACUUM) removes that
version's manifest between the conflicting commit and the rebase, checkout_version
returns DatasetNotFound and the unwrap() panics. In builds compiled with
panic = "abort" (common when Lance is embedded via FFI) this aborts the entire
host process instead of failing just the commit.
Observed in production as:
Fix
Return a Result from initial_fragments_for_rebase and propagate the error
instead of unwrapping. A commit whose read version has been garbage-collected now
fails gracefully with DatasetNotFound, allowing the caller to retry, rather than
panicking. All 5 call sites are updated to use ?.
This is a behavior change only for the previously-panicking path; the success path
is unchanged.
Test
Added test_rebase_errors_when_read_version_was_cleaned_up, which:
Verified the test fails (panics) without the fix and passes with it.
Verification