szetszwo commented on PR #6613:
URL: https://github.com/apache/ozone/pull/6613#issuecomment-3373086778
> the request lengths and the response lengths look quite random.
It may be due to the test which reads 1 byte and then some more bytes.
After changed the test to reads 10MB, it failed with IllegalStateException.
```
2025-10-06 10:49:36,161 [a38e63c4-83c0-4a67-ad0d-45b74141c76b-ChunkReader-4]
ERROR server.GrpcXceiverService (GrpcXceiverService.java:onNext(120)) - Got
exception when processing ContainerCommandRequestProto cmdType: ReadBlock
traceID: ""
containerID: 1
datanodeUuid: "a0bb7c49-0425-40d6-8347-e5f39552daf7"
version: 3
readBlock {
blockID {
containerID: 1
localID: 115816896921600001
blockCommitSequenceId: 16
}
offset: 8388608
len: 2097152
verifyChecksum: true
}
java.lang.IllegalStateException
at
com.google.common.base.Preconditions.checkState(Preconditions.java:497)
at
org.apache.hadoop.ozone.container.keyvalue.KeyValueHandler.readBlock(KeyValueHandler.java:2072)
at
org.apache.hadoop.ozone.container.common.impl.HddsDispatcher.streamDataReadOnly(HddsDispatcher.java:864)
at
org.apache.hadoop.ozone.container.common.transport.server.GrpcXceiverService$1.onNext(GrpcXceiverService.java:114)
at
org.apache.hadoop.ozone.container.common.transport.server.GrpcXceiverService$1.onNext(GrpcXceiverService.java:98)
at
org.apache.ratis.thirdparty.io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onMessage(ServerCalls.java:262)
at
org.apache.ratis.thirdparty.io.grpc.ForwardingServerCallListener.onMessage(ForwardingServerCallListener.java:33)
at
org.apache.hadoop.hdds.tracing.GrpcServerInterceptor$1.onMessage(GrpcServerInterceptor.java:49)
```
The change of `TestStreamBlockInputStream`:
```diff
@@ -73,7 +74,7 @@ void testAll(ContainerLayoutVersion layout) throws
Exception {
*/
private void testBlockReadBuffers(TestBucket bucket) throws Exception {
String keyName = getNewKeyName();
- int dataLength = (2 * BLOCK_SIZE) + (CHUNK_SIZE);
+ int dataLength = 10 << 20;
byte[] inputData = bucket.writeRandomBytes(keyName, dataLength);
try (KeyInputStream keyInputStream = bucket.getKeyInputStream(keyName))
{
@@ -82,13 +83,8 @@ private void testBlockReadBuffers(TestBucket bucket)
throws Exception {
(StreamBlockInputStream) keyInputStream.getPartStreams().get(0);
- // To read 1 byte of chunk data, ChunkInputStream should get one full
- // checksum boundary worth of data from Container and store it in
buffers.
- IOUtils.readFully(block0Stream, new byte[1]);
- checkBufferSizeAndCapacity(block0Stream.getCachedBuffers());
-
// Read > checksum boundary of data from chunk0
- int readDataLen = BYTES_PER_CHECKSUM + (BYTES_PER_CHECKSUM / 2);
+ int readDataLen = dataLength;
byte[] readData = readDataFromBlock(block0Stream, 0, readDataLen);
bucket.validateData(inputData, 0, readData);
```
--
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]