KnightChess commented on code in PR #11445:
URL: https://github.com/apache/hudi/pull/11445#discussion_r1639313872


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTable.java:
##########
@@ -713,11 +714,24 @@ private void 
deleteInvalidFilesByPartitions(HoodieEngineContext context, Map<Str
           final HoodieStorage storage = metaClient.getStorage();
           LOG.info("Deleting invalid data file=" + partitionFilePair);
           // Delete
-          try {
-            storage.deleteFile(new StoragePath(partitionFilePair.getValue()));

Review Comment:
   > I think it's a bug, not matter whether enable 
`hoodie.filesystem.operation.retry.enable` or not, we should not allow delete 
the file failed quietly, otherwise wrong result might happen. So change in 
`HoodieRetryWrapperFileSystem ` is not enough.
   
   yes, I know this is bug, so I mean `HoodieRetryWrapperFileSystem delete api` 
can also return flag boolean in this code.
   ```java
   @Override
     public boolean delete(Path f, boolean recursive) throws IOException {
       return new RetryHelper<Boolean, IOException>(maxRetryIntervalMs, 
maxRetryNumbers, initialRetryIntervalMs, retryExceptionsList)
           .tryWith(() -> fileSystem.delete(f, 
recursive)).start().booleanValue();
     }
   ```
   may be we can fix it in `HoodieRetryWrapperFileSystem` like this, but it's 
global
   ```java
   @Override
     public boolean delete(Path f, boolean recursive) throws IOException {
       return new RetryHelper<Boolean, IOException>(maxRetryIntervalMs, 
maxRetryNumbers, initialRetryIntervalMs, retryExceptionsList)
           .tryWith(() -> {
             boolean success = fileSystem.delete(f, recursive);
             if (!success) {
               if (fileSystem.exists(f)) {
                 throw new HoodieIOException("Failed to delete invalid path: " 
+ f);
               }
             }
             return success;
           }).start().booleanValue();
     }
   ```



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

Reply via email to