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

   ## What changes were proposed in this pull request?
   HDDS-16704. ReadBlock fails with IllegalStateException when a response is 
shorter than responseDataSize
   KeyValueHandler.readBlockImpl uses ReadBlockComputation to compute a 
checksum-aligned buffer limit per response.
   ReadBlockComputation.computeBufferLimit() calls findChunk(offset + 
responseDataSize) to locate the chunk at the end of
   the window, which advances the forward-only cursor (lastPosition) to offset 
+ responseDataSize. Whenever that response was shorter than responseDataSize 
(an unaligned chunk boundary inside the window, i.e. variable-sized chunks 
after hsync, or a short file read), the new position is below lastPosition and 
Preconditions.assertTrue(position >= lastPosition) throws IllegalStateException.
   Fix: compute the end chunk in computeBufferLimit without moving the 
findChunk cursor.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-16704
   
   ## How was this patch tested?
   UT.


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