aokolnychyi commented on a change in pull request #675: Inherit snapshot ids 
for manifest entries
URL: https://github.com/apache/incubator-iceberg/pull/675#discussion_r371890545
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java
 ##########
 @@ -381,9 +404,19 @@ private void cleanUncommittedAppends(Set<ManifestFile> 
committed) {
       this.cachedNewManifest = null;
     }
 
-    for (ManifestFile manifest : appendManifests) {
-      if (!committed.contains(manifest)) {
-        deleteFile(manifest.path());
+    // the clean-up logic depends on whether we append original manifests or 
their copies
+    // 1) if we rewrite manifests before appending them
+    //    we need to delete all uncommitted copies of manifests to prevent 
orphan metadata files
+    //    as the caller doesn't have access to them
+    // 2) if we append original manifests without rewriting them and the 
commit succeeds
+    //    we need to delete appended manifests that are merged with others 
while preparing a new snapshot
+    //    otherwise, the caller will have to find which appended manifests 
were merged but not committed
+    //    to prevent orphan metadata files
+    if (!snapshotIdInheritanceEnabled || !committed.isEmpty()) {
 
 Review comment:
   I've implemented an approach that is similar to the snippet above. I'll need 
to do one more pass to make sure I didn't forget anything.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to