ajantha-bhat commented on code in PR #4464:
URL: https://github.com/apache/iceberg/pull/4464#discussion_r843042500


##########
core/src/main/java/org/apache/iceberg/BaseTransaction.java:
##########
@@ -437,6 +430,25 @@ private void commitSimpleTransaction() {
     }
   }
 
+  private void applyUpdates(TableOperations underlyingOps) {
+    if (base != underlyingOps.refresh()) {
+      TableMetadata oldBase = base;
+      // use refreshed the metadata
+      this.base = underlyingOps.current();
+      this.current = underlyingOps.current();
+      for (PendingUpdate update : updates) {
+        // re-commit each update in the chain to apply it and update current
+        try {
+          update.commit();
+        } catch (CommitFailedException e) {
+          // fallback to old base, so that it refreshes again on retry and 
apply pending updates.
+          base = oldBase;

Review Comment:
   got it. `CommitFailedException` from `TableOperations.commit()` should be 
retired but not from the `PendingUpdate.commit()` as pending updates cannot 
successful even after the retry.



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