puchengy commented on code in PR #12818:
URL: https://github.com/apache/iceberg/pull/12818#discussion_r2071888795


##########
core/src/main/java/org/apache/iceberg/rest/RESTTableOperations.java:
##########
@@ -155,13 +158,21 @@ public void commit(TableMetadata base, TableMetadata 
metadata) {
     // the error handler will throw necessary exceptions like 
CommitFailedException and
     // UnknownCommitStateException
     // TODO: ensure that the HTTP client lib passes HTTP client errors to the 
error handler
-    LoadTableResponse response =
-        client.post(path, request, LoadTableResponse.class, headers, 
errorHandler);
+    try {
+      LoadTableResponse response =
+          client.post(path, request, LoadTableResponse.class, headers, 
errorHandler);
+      // all future commits should be simple commits
+      this.updateType = UpdateType.SIMPLE;
 
-    // all future commits should be simple commits
-    this.updateType = UpdateType.SIMPLE;
-
-    updateCurrentMetadata(response);
+      updateCurrentMetadata(response);
+    } catch (RESTException e) {
+      if (e.getCause() != null && e.getCause() instanceof IOException) {
+        // any IOException or unhandled Exception should be considered as 
commit unknown
+        // so that caller can attempt to potentially reconcile
+        throw new CommitStateUnknownException(e);
+      }
+      throw e;
+    }

Review Comment:
   @singhpk234 I took a second look and I found one difference between my 
internal version (spark 3.2 + iceberg 1.3) and the latest version: the 
`cleanupOnAbort` by default is `true` in the old version but it is set as 
`false` in the new version. It seems to be introduced by 
https://github.com/apache/iceberg/pull/10373 by @amogh-jahagirdar. So for my 
issues mentioned in the issue ticket, I should be good for now. I made a reply 
at https://github.com/apache/iceberg/issues/12792#issuecomment-2847728706



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to