Skip to content

fix: give every transaction file a fresh per-attempt name - #11657

Merged
westonpace merged 3 commits into
mainfrom
will/txn-file-per-attempt-name
Dec 1, 2026
Merged

westonpace merged 3 commits into
mainfrom
will/txn-file-per-attempt-name

Conversation

@wjones127

@wjones127 wjones127 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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 with NotFound. Keyed appends (#11411) already used a fresh per-attempt id; this makes every transaction file use one. Readers find the file through manifest.transaction_file and never parse the name.

Evidence

Two regressions in commit::tests, both failing before this change and passing after:

  • failed_resubmission_keeps_committed_transaction_file commits 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 with NotFound without the fix.

Merge Risk

Door: two-way. The name still matches the documented {read_version}-{uuid}.txn pattern; 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 warnings trips on two pre-existing dead-code items in lance-io, untouched here.)

Fixes #11656

@github-actions github-actions Bot added critical-fix Bugs that cause crashes, security vulnerabilities, or incorrect data. bug Something isn't working labels Nov 30, 2026
@wjones127
wjones127 marked this pull request as ready for review November 30, 2026 20:29

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 30, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@geruh geruh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally with the regression test from #11658. Fails on main for both attached and detached commits and passes with this change.

I like removing attempt_id altogether. LGTM with the test from #11658 or it can wait

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]>
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Dec 1, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Dec 1, 2026

@westonpace westonpace left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ported over the unit test

@westonpace
westonpace merged commit 1b92f1c into main Dec 1, 2026
43 of 45 checks passed
@westonpace
westonpace deleted the will/txn-file-per-attempt-name branch December 1, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working critical-fix Bugs that cause crashes, security vulnerabilities, or incorrect data. K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: failed resubmission of a committed transaction deletes its transaction file

4 participants