Repository navigation
fix: give every transaction file a fresh per-attempt name - #11657
Conversation
… file Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Xuanwo
left a comment
There was a problem hiding this comment.
[AI] Could you bring standalone_failed_resubmission_preserves_committed_transaction from #11658 into this PR? The current test checks that the transaction file still exists after a failed replay. The test in #11658 forces the transaction to be stored out of line, then reads back both attached and detached versions and verifies that a stale attached writer can catch up.
The existing regression commits an inline transaction, so it can only assert the file survives on disk. Add the attached and detached cases against a transaction too large to inline, where the committed version is readable only through its transaction file, and check that a stale attached writer can still catch up past it. Both cases fail with NotFound without the per-attempt file name. Co-Authored-By: Claude Opus 5 <[email protected]>
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The added regressions cover attached and detached reads of spilled transactions, plus stale-writer catch-up after a failed replay. Fresh file names give each write its own cleanup target while preserving manifest-based lookup and garbage collection.
This overlaps with #11658, which fixes the same naming collision; only one implementation is needed.
Please mark this PR with the breaking-change label: lance_table_runtime::commit::write_transaction_file removes attempt_id, so direct Rust callers must omit the fourth argument.
westonpace
left a comment
There was a problem hiding this comment.
I ported over the unit test
Summary
Transaction files were named
<read_version>-<transaction.uuid>.txn, so submitting an already-committed transaction again (for example, a retry after an ambiguous timeout) wrote to the committed version's transaction file. If that attempt then failed, its cleanup deleted the file, and reading that version's transaction or catching up past it failed withNotFound. Keyed appends (#11411) already used a fresh per-attempt id; this makes every transaction file use one. Readers find the file throughmanifest.transaction_fileand never parse the name.Evidence
Two regressions in
commit::tests, both failing before this change and passing after:failed_resubmission_keeps_committed_transaction_filecommits an append, resubmits it with a commit handler that conflicts, and asserts the committed version's transaction file still exists on disk.failed_resubmission_keeps_spilled_transaction(attached and detached) does the same against a transaction too large to inline, so the committed version is readable only through its transaction file. It asserts the recorded transaction still reads back and that a stale attached writer can catch up past the committed version. Both cases fail withNotFoundwithout the fix.Merge Risk
Door: two-way. The name still matches the documented
{read_version}-{uuid}.txnpattern; only the UUID's source changes.Blast Radius: commit path.
Validation
cargo test --profile ci -p lance-table-runtime --lib --features tokio/test-util: 575 passed.cargo fmt --all --check.cargo clippy -p lance-table-runtime --all-targets: no warnings in this crate. (-D warningstrips on two pre-existing dead-code items inlance-io, untouched here.)Fixes #11656