Jackie-Jiang commented on code in PR #17294:
URL: https://github.com/apache/pinot/pull/17294#discussion_r2600579079


##########
pinot-spi/src/main/java/org/apache/pinot/spi/filesystem/BasePinotFS.java:
##########
@@ -36,6 +36,11 @@ public boolean deleteBatch(List<URI> segmentUris, boolean 
forceDelete)
       throws IOException {
     boolean result = true;
     for (URI segmentUri : segmentUris) {
+      // Check if file exists before attempting deletion to avoid 
FileNotFoundException
+      if (!exists(segmentUri)) {

Review Comment:
   This makes the contract for `deleteBatch()` and `delete()` different.
   
   We need to decide the behavior for the following scenarios:
   - For `delete()`
     - File exists
       - File is dir
         - Deleted
         - Not deleted
       - File is ordinary file
         - Deleted
         - Not deleted
     - File doesn't exist
   - For `deleteBatch()`
     - All files deleted
     - Some files deleted
     - None file deleted
   
   @swaminathanmanish @KKcorps @abhishekbafna Can you please also comment here?



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