You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "prashantwason (via GitHub)" <gi...@apache.org> on 2026/01/29 04:51:05 UTC

[PR] fix(clean): Return success for FileNotFoundException during clean to properly update MDT [hudi]

prashantwason opened a new pull request, #18034:
URL: https://github.com/apache/hudi/pull/18034

   ### Describe the issue this Pull Request addresses
   
   When a `FileNotFoundException` is thrown during file deletion in the clean operation, the file is already gone. However, the current code returns `false` (failure) which causes the Metadata Table (MDT) to not be updated. This leads to subsequent clean runs repeatedly targeting the same already-deleted files for deletion.
   
   For a tier-1 table receiving lots of updates, this resulted in a partition with > 1M files that couldn't be cleaned.
   
   Related to HUDI-3766.
   
   ### Summary and Changelog
   
   **Summary:** Fix clean operation to treat `FileNotFoundException` as a successful deletion so MDT is updated correctly.
   
   **Changelog:**
   - Modified `CleanActionExecutor.deleteFileAndGetResult()` to return `true` instead of `false` when catching `FileNotFoundException`
   - Added debug logging for when a file is not found during clean
   - Updated comment to explain the reasoning behind treating missing files as successful deletions
   
   ### Impact
   
   This fix ensures that when files are already deleted (e.g., by a previous clean attempt or external process), the MDT is properly updated to reflect this. Without this fix, MDT retains entries for deleted files, causing repeated deletion attempts in subsequent clean runs.
   
   ### Risk Level
   
   low - The change is minimal and follows the existing logic pattern where a missing file during deletion should be treated as success (the goal of deletion is achieved - the file doesn't exist).
   
   ### Documentation Update
   
   none - No new configs or user-facing features are added.
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(clean): Return success for FileNotFoundException during clean to properly update MDT [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #18034:
URL: https://github.com/apache/hudi/pull/18034#issuecomment-3815481913

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ef4d9f47db8d281936066ed789bcb249971c4cc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "5ef4d9f47db8d281936066ed789bcb249971c4cc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5ef4d9f47db8d281936066ed789bcb249971c4cc UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(clean): Return success for FileNotFoundException during clean to properly update MDT [hudi]

Posted by "prashantwason (via GitHub)" <gi...@apache.org>.
prashantwason closed pull request #18034: fix(clean): Return success for FileNotFoundException during clean to properly update MDT
URL: https://github.com/apache/hudi/pull/18034


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(clean): Return success for FileNotFoundException during clean to properly update MDT [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #18034:
URL: https://github.com/apache/hudi/pull/18034#issuecomment-3815491139

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ef4d9f47db8d281936066ed789bcb249971c4cc",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=11485",
       "triggerID" : "5ef4d9f47db8d281936066ed789bcb249971c4cc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5ef4d9f47db8d281936066ed789bcb249971c4cc Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=11485) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org