Fokko opened a new issue, #4533:
URL: https://github.com/apache/iceberg-python/issues/4533

   **Apache Iceberg version:** main (development)
   
   ### Please describe the bug 🐞
   
   `GlueCatalog.commit_table` calls `glue.update_table(..., VersionId=...)` for 
optimistic locking. The boto3 client retries automatically (`standard` mode, 
`glue.max-retries` defaults to 10). If Glue applies an attempt but the response 
is lost, for example on a read timeout or a 5xx, botocore sends the same 
request again with the same `VersionId`. Glue has already moved past that 
version and rejects it with `ConcurrentModificationException`. 
`_update_glue_table` maps that to `CommitFailedException`, although the commit 
landed.
   
   `CommitFailedException` should mean the commit did not apply. 
`Transaction.commit_transaction` now works around this with 
`_attempt_landed()`, which looks for the transaction's snapshot IDs in the 
refreshed table. That check only runs for transactions that add snapshots. It 
also misses a landed commit whose snapshots another writer has already expired 
(ISSUE2_PLACEHOLDER). A metadata-only change, like a schema update, that landed 
is still reported as failed.
   
   Java fixed this in apache/iceberg#7198. `GlueTableOperations.doCommit` 
attaches a `RetryDetector` to the Glue client. When the commit fails after the 
client retried, or fails with an unexpected exception, it runs 
`checkCommitStatus`, which looks for the new metadata location in the table's 
current metadata and its metadata log:
   - found: the commit succeeded, and the exception is dropped
   - not found, and the error is `ConcurrentModificationException`: 
`CommitFailedException`
   - otherwise: `CommitStateUnknownException`
   
   ### Proposed fix
   
   Port this to `GlueCatalog.commit_table`. botocore records retries on errors 
in `e.response["ResponseMetadata"]["RetryAttempts"]`, so no extra hook is 
needed. Because the check looks at metadata locations instead of snapshots, it 
still works after snapshots are expired.
   


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