Repository navigation
fix(commit): remove the transaction file of a refused manifest build - #11706
westonpace wants to merge 1 commit into
Conversation
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.
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>
cebb5fd to
07ec0b5
Compare
There was a problem hiding this comment.
✅ 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.
There was a problem hiding this comment.
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
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_segmentsandvalidate_frag_reuse_historyboth 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 — amigrate_manifestIO 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
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_transactionsand_versionsare both unchanged and the dataset still opens at the prior version.left: 3, right: 2on the transaction-file count — and passes with it.cargo test -p lance --lib— 12221 passed;cargo test -p lance-table-runtime --lib— 585 passedcargo clippy -p lance-table-runtime -p lance --testsandcargo fmt --allcleanThe fix is in
lance-table-runtimeand the test inlance, because the commit path only becomes exercisable with a real dataset and a real index.🤖 Generated with Claude Code