Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the transaction retry changes.
No open issues 🎉
What changed in this PR
Addresses #3743 by letting transaction retries recognize a previously successful commit, avoiding repeated actions and unnecessary manifest writes after a lost response.
Changes:
- Retains snapshot IDs and manifest-list paths from prior commit attempts.
- Checks refreshed metadata for a matching snapshot before reapplying actions.
- Adds regression tests for retry conflicts, concurrent writes, delayed commits, snapshot expiration, and transient refresh failures.
The PR description could be shortened by focusing on rationale and assumptions rather than implementation details.
| File | Description |
|---|---|
crates/iceberg/src/transaction/mod.rs |
Adds prior-commit detection and regression tests for transaction retries. |
Review effort: Balanced
This branch has not been deployed
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.
Which issue does this PR close?
Transaction::do_commitfails on retry after a previous attempt already committed #3743.What changes are included in this PR?
(snapshot_id, manifest_list)witnesses submitted in prior commit attempts onTransaction, filtering out empty manifest lists, snapshots already present in the base metadata, and snapshots removed within the same transaction.Transaction::do_commit, right aftercatalog.load_table, returnOk(refreshed)if any recorded(snapshot_id, manifest_list)witness already exists inrefreshed.metadata()with a matching manifest list path. Because eachTableCommitis atomic on the catalog, any surviving witness confirms the attempt landed even if a concurrent writer committed on top or expired another snapshot from a multi snapshot commit, and retaining witnesses across attempts handles transientload_tableerrors and delayed earlier attempts.Are these changes tested?
Yes. Added unit tests in
crates/iceberg/src/transaction/mod.rscovering post commit retryable conflicts with duplicate checking enabled and disabled (verifying no orphan manifest list is written viaFileIO::exists), concurrent commits landing on top of the committed snapshot, genuine pre commit conflicts, delayed first attempts landing after a second attempt, partial expiration of a multi snapshot commit, transientload_tablefailures between attempts, and a negative check ensuring a matching snapshot ID with a different manifest list is not treated as committed.AI Disclosure
I used AI coding tools to help draft the code, tests, and this description. I reviewed the changes, ran the test and lint checks, and can explain the design.