amogh-jahagirdar commented on code in PR #9354:
URL: https://github.com/apache/iceberg/pull/9354#discussion_r1433548763


##########
core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java:
##########
@@ -892,15 +892,18 @@ private void cleanUncommittedAppends(Set<ManifestFile> 
committed) {
       }
     }
 
-    ListIterator<ManifestFile> deleteManifestsIterator = 
cachedNewDeleteManifests.listIterator();
-    while (deleteManifestsIterator.hasNext()) {
-      ManifestFile deleteManifest = deleteManifestsIterator.next();
-      if (!committed.contains(deleteManifest)) {
-        deleteFile(deleteManifest.path());
-        deleteManifestsIterator.remove();
+    boolean hasDeleteDeletes = false;
+    for (ManifestFile cachedNewDeleteManifest : cachedNewDeleteManifests) {
+      if (!committed.contains(cachedNewDeleteManifest)) {
+        deleteFile(cachedNewDeleteManifest.path());
+        hasDeleteDeletes = true;

Review Comment:
   Also another nit: I'd probably use the same pattern we did for the data 
manifest case where we just null it out and don't exercise the loop if it's 
null, but I see that the logic is the same with clearing the cached manifests 
and the loop.



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