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

     ### Describe the issue this Pull Request addresses
   
     This PR addresses a corruption scenario where completed commit files in 
the timeline are 0 bytes. When this happens, reading the commit metadata fails 
silently or
     produces unexpected behavior. This fix adds explicit validation to detect 
and throw a meaningful error when a completed commit file has no contents.
   
     ### Summary and Changelog
   
     Users will now get a clear error message when Hudi detects a corrupted 
(0-byte) completed commit file in the timeline, making it easier to identify 
and debug timeline
     corruption issues.
   
     **Changes:**
     - Added validation in `TimelineUtils.getMetadataValue()` to check if 
completed commit files have zero-byte content
     - Throws `HoodieIOException` with a descriptive message when a completed 
commit has no contents
     - Added comprehensive test 
`testGetExtraMetadataFromLatestAfterZeroByteOlderCommitFile()` to verify the 
behavior
   
     ### Impact
   
     This change improves error handling and debugging experience when timeline 
corruption occurs. No public API changes. No performance impact as the 
validation only checks
     the already-loaded byte array length.
   
     ### Risk Level
   
     **Low** - This is a defensive check that only throws an exception in a 
corruption scenario that would have failed anyway. The fix makes the failure 
more explicit and
     easier to diagnose.
   
     ### Documentation Update
   
     None - This is an internal error handling improvement with no user-facing 
configuration or feature changes.
   
     ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to