grantatspothero commented on code in PR #10523:
URL: https://github.com/apache/iceberg/pull/10523#discussion_r1643557930


##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -423,21 +423,23 @@ public void commit() {
     try {
       LOG.info("Committed snapshot {} ({})", newSnapshotId.get(), 
getClass().getSimpleName());
 
-      // at this point, the commit must have succeeded. after a refresh, the 
snapshot is loaded by
-      // id in case another commit was added between this commit and the 
refresh.
-      Snapshot saved = ops.refresh().snapshot(newSnapshotId.get());
-      if (saved != null) {
-        cleanUncommitted(Sets.newHashSet(saved.allManifests(ops.io())));
-        // also clean up unused manifest lists created by multiple attempts
-        for (String manifestList : manifestLists) {
-          if (!saved.manifestListLocation().equals(manifestList)) {
-            deleteFile(manifestList);
+      if (!canSkipCleanupAfterCommitSuccess()) {
+        // at this point, the commit must have succeeded. after a refresh, the 
snapshot is loaded by
+        // id in case another commit was added between this commit and the 
refresh.
+        Snapshot saved = ops.refresh().snapshot(newSnapshotId.get());

Review Comment:
   If it does, it is undefined behavior. Currently if the refresh fails the 
operation does not fail it instead logs a warning and continues on. For that 
reason, seems safe to skip the refresh



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