hcrosse opened a new pull request, #3744:
URL: https://github.com/apache/iceberg-rust/pull/3744

   ## Which issue does this PR close?
   
   - Closes #3743.
   
   ## What changes are included in this PR?
   
   - Track newly added `(snapshot_id, manifest_list)` witnesses submitted in 
prior commit attempts on 
[`Transaction`](https://github.com/apache/iceberg-rust/blob/a7160a0a2318028df1a8ae88abbb3b5d611fa3d8/crates/iceberg/src/transaction/mod.rs#L87-L90),
 filtering out empty manifest lists, snapshots already present in the base 
metadata, and snapshots removed within the same transaction.
   - In 
[`Transaction::do_commit`](https://github.com/apache/iceberg-rust/blob/a7160a0a2318028df1a8ae88abbb3b5d611fa3d8/crates/iceberg/src/transaction/mod.rs#L221-L253),
 right after `catalog.load_table`, return `Ok(refreshed)` if any recorded 
`(snapshot_id, manifest_list)` witness already exists in `refreshed.metadata()` 
with a matching manifest list path. Because each `TableCommit` is 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 transient `load_table` 
errors and delayed earlier attempts.
   - Terminal and non retryable unknown state failures (such as REST 
500/502/504 responses or exhausted retry budgets) keep their existing behavior 
and are left outside the scope of this PR.
   
   ## Are these changes tested?
   
   Yes. Added unit tests in `crates/iceberg/src/transaction/mod.rs` covering 
post commit retryable conflicts with duplicate checking enabled and disabled 
(verifying no orphan manifest list is written via `FileIO::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, transient `load_table` failures 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to