This is an automated email from the ASF dual-hosted git repository.

danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new c859ea4cd23 Revert "[MINOR] Check the return value from delete during 
rollback and finalize to ensure the files actually got deleted (#8606)" (#8803)
c859ea4cd23 is described below

commit c859ea4cd23bc4ae56fca4914f34bbf5858bfde5
Author: Danny Chan <[email protected]>
AuthorDate: Thu May 25 11:24:40 2023 +0800

    Revert "[MINOR] Check the return value from delete during rollback and 
finalize to ensure the files actually got deleted (#8606)" (#8803)
    
    This reverts commit b28eeafea68fd1c35dddbd39fe7bdb995a1ad965.
---
 .../src/main/java/org/apache/hudi/table/HoodieTable.java      |  5 +----
 .../apache/hudi/table/action/rollback/BaseRollbackHelper.java | 11 ++---------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTable.java
 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTable.java
index d845c125988..668abef4ea0 100644
--- 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTable.java
+++ 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTable.java
@@ -675,10 +675,7 @@ public abstract class HoodieTable<T, I, K, O> implements 
Serializable {
           LOG.info("Deleting invalid data file=" + partitionFilePair);
           // Delete
           try {
-            Path pathToBeDeleted = new Path(partitionFilePair.getValue());
-            if (!fileSystem.delete(pathToBeDeleted, false) && 
fileSystem.exists(pathToBeDeleted)) {
-              throw new HoodieException("Failed to delete the invalid data 
file " + pathToBeDeleted);
-            }
+            fileSystem.delete(new Path(partitionFilePair.getValue()), false);
           } catch (IOException e) {
             throw new HoodieIOException(e.getMessage(), e);
           }
diff --git 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackHelper.java
 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackHelper.java
index 2bf7a9c5ebf..a95b3a3dc5c 100644
--- 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackHelper.java
+++ 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackHelper.java
@@ -197,21 +197,14 @@ public class BaseRollbackHelper implements Serializable {
             // if first rollback attempt failed and retried again, chances 
that some files are already deleted.
             isDeleted = true;
           }
-
-          if (!isDeleted) {
-            // ensure the file does not exist
-            if (metaClient.getFs().exists(fullDeletePath)) {
-              throw new HoodieRollbackException("Failed to delete file " + 
fullDeletePath);
-            }
-            isDeleted = true;
-          }
         }
         return HoodieRollbackStat.newBuilder()
             .withPartitionPath(partitionPath)
             .withDeletedFileResult(fullDeletePath.toString(), isDeleted)
             .build();
       } catch (IOException e) {
-        throw new HoodieIOException("Deleting file " + fileToDelete + " failed 
", e);
+        LOG.error("Fetching file status for ");
+        throw new HoodieIOException("Fetching file status for " + fileToDelete 
+ " failed ", e);
       }
     }).collect(Collectors.toList());
   }

Reply via email to