Skip to content

fix(commit): remove the transaction file of a refused manifest build - #11706

Open
westonpace wants to merge 1 commit into
mainfrom
claude/commit-refusal-cleans-transaction-file
Open

westonpace wants to merge 1 commit into
mainfrom
claude/commit-refusal-cleans-transaction-file

Conversation

@westonpace

@westonpace westonpace commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Summary

A commit writes its transaction file before the attempt is judged, so a refusal between that write and the manifest write leaves the file referenced by nothing. validate_new_segments and validate_frag_reuse_history both clean up for exactly that reason; the manifest build sitting between them did not.

That build runs the last of the structural checks on what the attempt would publish — covering fields, MemWAL rules, clustering references, and whether an index's segments can coexist — so its refusals are as final as the two around it.

Scope

Only the manifest build. Every other ? between the two writes still orphans a file on an internal error — a migrate_manifest IO failure, say. Those are not refusals of the caller's intent and the orphaned file is the least of the problem, so I left them; collapsing the whole region into one cleanup is a larger change to the commit hot path and belongs on its own.

Test plan

  • New test_refused_manifest_build_removes_its_transaction_file: commits a row-id-domain BTree segment under the same name as a row-address-domain one, asserts the refusal, then that _transactions and _versions are both unchanged and the dataset still opens at the prior version.
  • Verified it fails without the fix — left: 3, right: 2 on the transaction-file count — and passes with it.
  • cargo test -p lance --lib — 12221 passed; cargo test -p lance-table-runtime --lib — 585 passed
  • cargo clippy -p lance-table-runtime -p lance --tests and cargo fmt --all clean

The fix is in lance-table-runtime and the test in lance, because the commit path only becomes exercisable with a real dataset and a real index.

🤖 Generated with Claude Code

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

@github-actions github-actions Bot added the bug Something isn't working label Dec 1, 2026
@westonpace
westonpace requested a review from wjones127 December 1, 2026 23:04
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Dec 1, 2026
The transaction file is written before an attempt is judged, so a refusal
leaves it referenced by nothing. The two validations that run just after
the manifest build already clean up; the build itself did not, and it
runs the last of the structural checks on what the attempt would publish
-- an index set whose segments cannot coexist, say.

Every other `?` between the file's write and the manifest write still
leaves one behind on an internal error. Those are not refusals of the
caller's intent, so they are left for a follow-up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@westonpace
westonpace force-pushed the claude/commit-refusal-cleans-transaction-file branch from cebb5fd to 07ec0b5 Compare December 1, 2026 23:50
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. 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 rebase includes the per-attempt transaction-file fix in #11657, resolving the earlier history-deletion concern. Manifest-build refusals can now safely remove the attempt's own transaction file.

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

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

This looks good to me. I've been looking at this area as part of the refactoring and crate splitting work, and I think there's an opportunity to better separate metadata preparation and validation from publication.

For instance, we currently write the transaction file, prepare the attempt, build and validate the manifest, and then publish. maybe we instead allocate the transaction file path upfront (or factor it out until prior to pub), go through preparation, build and validation, and then write the transaction file before publishing the manifest?

That way, as we introduce more validations, we wouldn't have to remember to clean up the transaction file at each step.

could be done as part of the future work as well just curious about thoughts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants