-
Notifications
You must be signed in to change notification settings - Fork 593
[Ozone-Streaming] HDDS-6139. Fix incorrect computation of totalAckDataLength. #2978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
szetszwo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sadanand48 , the change looks good. Just two minor comments inlined.
| checksum = new Checksum(config.getChecksumType(), | ||
| config.getBytesPerChecksum()); | ||
| metrics = XceiverClientManager.getXceiverClientMetrics(); | ||
| buffersForPutBlock = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line. The list will be created in writeChunk(..).
| keyDataStreamOutput.getStreamEntries().get(0); | ||
| key.write(ByteBuffer.wrap(data)); | ||
| key.close(); | ||
| Assert.assertTrue(stream.getTotalAckDataLength()==dataLength); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use assertEquals, i.e.
Assert.assertEquals(dataLength, stream.getTotalAckDataLength());
szetszwo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 the change looks good.
|
Thanks @sadanand48 for the contribution. |
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java
Show resolved
Hide resolved
…aLength. (apache#2978) (cherry picked from commit 156cd46)
What changes were proposed in this pull request?
In the current streaming code we maintain only one bufferList for retry. Buffers in the list are removed only during watchForCommit. So there might occur a case if putBlock is followed by another putBlock the commitInfoMap has the same list for both indexes which will cause incorrect computation of totalAckDatalength which is used during retry
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6139
How was this patch tested?
unit test