rdblue commented on code in PR #15511:
URL: https://github.com/apache/iceberg/pull/15511#discussion_r2934210413


##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -509,22 +509,27 @@ public void commit() {
         throw e;
       }
 
-      // at this point, the commit must have succeeded so the stagedSnapshot 
is committed
-      Snapshot committedSnapshot = stagedSnapshot.get();
       try {
-        LOG.info(
-            "Committed snapshot {} ({})",
-            committedSnapshot.snapshotId(),
-            getClass().getSimpleName());
+        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.

Review Comment:
   Would be nice to mention the case we're fixing: that we may not know _which_ 
attempt succeded in some cases and we will only clean up the one that actually 
did.



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