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

   ### Describe the issue this Pull Request addresses
   
   Closes #20132.
   
   When a native data or delete file reaches its size limit, writing the next 
record triggers a rollover flush inside `writeRecord()`. With 
`hoodie.write.ignore.failed=true`, a flush failure is currently treated as a 
failure of just that record, and the loop can continue using a writer whose 
batch was not finalized successfully.
   
   Flush failures affect the buffered batch and must propagate regardless of 
the record-level ignore setting.
   
   ### Summary and Changelog
   
   - Introduce `HoodieLogFlushException` extending `HoodieException` to 
distinguish flush failures from generic append errors.
   - Wrap native flush and append-result finalization failures with this 
exception while preserving the original cause.
   - Make `HoodieAppendHandle` close the handle and propagate flush failures 
even when failed record writes may be ignored.
   - Add regression cases for data/delete rollover, I/O exceptions, runtime 
exceptions, errors, suppressed cleanup failures, and stopping before the next 
record. Verify ordinary I/O and generic append errors still honor the ignore 
setting.
   
   Validation: all 20 tests in `TestHoodieAppendHandle` and 
`TestHoodieNativeLogAppendHandle` pass, with no failures, errors, or skips. 
Checkstyle passes.
   
   ```bash
   mvn -o -pl hudi-client/hudi-client-common -am \
     -Dtest=TestHoodieAppendHandle,TestHoodieNativeLogAppendHandle \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -DskipITs -DskipSparkTests -DskipScalaTests test
   ```
   
   ### Impact
   
   Native log flush failures abort the write handle instead of being recorded 
as isolated record failures. Ordinary record failures retain their existing 
behavior. No new configuration is introduced; the dedicated exception type 
extends `HoodieException` directly.
   
   ### Risk Level
   
   Low. The behavior change is limited to native log flush failure propagation. 
Tests exercise both data and delete rollover and verify that generic append 
errors remain ignorable.
   
   ### Documentation Update
   
   The new exception's Javadoc documents that flush failures affect the batch 
and must abort the handle even when individual record failures may be ignored.
   
   ### Contributor's checklist
   
   - [ ] 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