stevenzwu commented on code in PR #4687:
URL: https://github.com/apache/iceberg/pull/4687#discussion_r865079497


##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java:
##########
@@ -196,24 +199,33 @@ private void commitOperation(SnapshotUpdate<?> operation, 
String description) {
     }
 
     long start = System.currentTimeMillis();
-    operation.commit(); // abort is automatically called if this fails
-    long duration = System.currentTimeMillis() - start;
-    LOG.info("Committed in {} ms", duration);
+    try {
+      operation.commit(); // abort is automatically called if this fails
+      long duration = System.currentTimeMillis() - start;
+      LOG.info("Committed in {} ms", duration);
+    } catch (CommitStateUnknownException commitStateUnknownException) {

Review Comment:
   @RussellSpitzer here is what I meant in the meeting. Instead of catching 
exceptions that we should skip abort, we can only catch `CommitFailedException` 
where SparkWrite should execute the abort action. For all other exceptions, we 
skip abort as we don't know whether it is safe or not. That may require change 
in iceberg-core to wrap all exceptions from commit action with 
`CommitFailedException` if it is not the case already.



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