mhatipog opened a new pull request, #18900:
URL: https://github.com/apache/iceberg/pull/18900

   ## Summary
   
   Fixes #18758 by preventing a transaction with directly staged metadata from 
reporting success after a concurrent commit silently discards its changes.
   
   `RESTCatalogAdapter.commitTransaction` stages changes through 
`CatalogHandlers.commit` on transaction `TableOperations`, without registering 
a `PendingUpdate`. After a conflicting commit, `BaseTransaction.applyUpdates` 
refreshes the table and replays an empty pending-update list, discarding the 
intended write and potentially returning success.
   
   ## Fix
   
   If the table changed and there are no pending updates to replay, fail with a 
non-retryable `CommitFailedException` through the existing 
`PendingUpdateFailedException` path. Preserve the normal retry/replay behavior 
when pending updates exist.
   
   ## Tests
   
   - Directly staged metadata commits successfully when there is no conflict.
   - A competing property commit makes the staged transaction fail instead of 
reporting success and dropping its update. The competing write stays intact.
   
   Both cases are added to the parameterized `TestTransaction` suite.
   
   ## Verification
   
   Static review and two-file diff checks completed. **Java tests not executed 
locally** because a complete Iceberg build is unavailable in this environment; 
upstream CI verification is required.
   
   This fixes the core transaction invariant. REST catalog implementations 
carrying their own copies or versions of the adapter may require separate 
changes.


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