rdblue commented on a change in pull request #2932:
URL: https://github.com/apache/iceberg/pull/2932#discussion_r685321529



##########
File path: 
core/src/main/java/org/apache/iceberg/actions/BaseRewriteDataFilesAction.java
##########
@@ -268,23 +270,36 @@ public RewriteDataFilesActionResult execute() {
     return tasksGroupedByPartition.asMap();
   }
 
-  private void replaceDataFiles(Iterable<DataFile> deletedDataFiles, 
Iterable<DataFile> addedDataFiles,
-                                long startingSnapshotId) {
+  private void replaceDataFiles(
+      Iterable<DataFile> deletedDataFiles, Iterable<DataFile> addedDataFiles,
+      long startingSnapshotId) {
     try {
-      RewriteFiles rewriteFiles = table.newRewrite()
-          .validateFromSnapshot(startingSnapshotId)
-          .rewriteFiles(Sets.newHashSet(deletedDataFiles), 
Sets.newHashSet(addedDataFiles));
-      commit(rewriteFiles);
+      doReplace(deletedDataFiles, addedDataFiles, startingSnapshotId);
     } catch (Exception e) {
-      Tasks.foreach(Iterables.transform(addedDataFiles, f -> 
f.path().toString()))
-          .noRetry()
-          .suppressFailureWhenFinished()
-          .onFailure((location, exc) -> LOG.warn("Failed to delete: {}", 
location, exc))
-          .run(fileIO::deleteFile);
+      if (e instanceof CommitStateUnknownException) {
+        LOG.warn("for unknown commiting state ,we should not delete file ");

Review comment:
       Please copy the other warning messages here. This needs to conform more 
to the error message expectations that we use:
   * Messages should use sentence case
   * Do not use personal pronouns
   * Be clear about what happened and what action is being taken
   
   This should be something more like "Skipping commit cleanup: commit state is 
unknown". But check the other places where we catch 
`CommitStateUnknownException` and use a similar message.




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