len548 opened a new pull request, #11143:
URL: https://github.com/apache/ozone/pull/11143
## What changes were proposed in this pull request?
`BlockDataStreamOutputhsync()` has an empty catch block that discards all
exceptions from `handleFlush()`. This means a failed `putBlock` or
`watchForCommit` during hsync is silently ignored, and the caller believes the
sync succeeded. `KeyDataStreamOutput` then proceeds to call OM `hsyncKey`() for
data that was never acknowledged by datanodes.
The Ratis path (`RatisBlockOutputStream.hsync()`) correctly propagates
exceptions. The fix aligns the `DataStream` hsync with the Ratis behavior,
propagate `IOException` directly, wrap checked exceptions in `IOException`.
At the key level, `KeyDataStreamOutput.handleFlushOrClose()` treat HSYNC
like WRITE/FLUSH/CLOSE. All of failures go through `handleException`, which
could:
1. Clean up the failed block stream.
2. Loop and call `hsync()` again on a closed stream.
3. Return to `KeyDataStreamOutput.hsync()` and call OM `hsyncKey()` for data
never committed via putBlock.
To prevent that, this fix inserted in catch block of
`KeyDataStreamOutput.handleFlushOrClose()`:
```
if (op == StreamAction.HSYNC) {
throw ioe;
}
```
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15225
## How was this patch tested?
Unit tests skipped in #10230 turn green.
--
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]