Sergey Soldatov created HDDS-16704:
--------------------------------------
Summary: ReadBlock fails with IllegalStateException when a
response is shorter than responseDataSize
Key: HDDS-16704
URL: https://issues.apache.org/jira/browse/HDDS-16704
Project: Apache Ozone
Issue Type: Bug
Components: Ozone Datanode
Affects Versions: 2.2.1
Reporter: Sergey Soldatov
Assignee: Sergey Soldatov
Regression from HDDS-15857. 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. After the
response is sent, readBlockImpl calls findChunk(adjustedOffset) with the offset
actually reached. 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. The ReadBlock fails on all replicas.
Example: chunks [1024, 20, 4096], bytesPerChecksum=1024, responseDataSize=2048,
read 0..5140: the first limit is 1044, then findChunk(1044) fails against
lastPosition=2048.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]