chungen0126 opened a new pull request, #11551:
URL: https://github.com/apache/ozone/pull/11551

   ## What changes were proposed in this pull request?
   
   With `ozone.client.stream.read.block` enabled, a reader can't read all 
hsync'ed data of a file that is still being written. It hits EOF at the block 
length OM last recorded, which can be stale for the last block because 
`hsyncKey` only updates OM when the last block changes. `BlockInputStream` 
handles this by getting the real length from the datanode for an 
under-construction block; `StreamBlockInputStream` did not.
   
   This PR passes the under-construction flag to `StreamBlockInputStream`. 
Before the first read, the stream sends one `GetBlock` to get the real length, 
using the existing retry handling. Other blocks send no extra RPC.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-15886
   
   ## How was this patch tested?
   
   - New unit tests in `TestStreamBlockInputStream`.
   - `TestOzoneContractFSO` with `streamReadBlock` enabled: `testSyncable` 
fails before this change and passes after. It also passes with 
`streamReadBlock` disabled.
   
   Generated-by: Claude Code (Claude Opus 5.5)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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