-
Notifications
You must be signed in to change notification settings - Fork 592
HDDS-5674.[Ozone-Streaming] Handle client retries on exception #2701
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
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java
Outdated
Show resolved
Hide resolved
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 , thanks a lot for working on this.
In Streaming, we should not have a buffer pool since we won't reuse buffers. We probably need a new class for the bufferList. Then, we can put all the related logic inside the new class.
BTW, please add some tests. Thanks.
...e/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockDataStreamOutputEntryPool.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyDataStreamOutput.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamCommitWatcher.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java
Outdated
Show resolved
Hide resolved
|
Thanks @szetszwo and @bshashikant for the review. Yes I will be adding more tests. Also , we are not using Currently on retry , we discard the previous buffers in the bufferList and start from 0 regardless of whether all the nodes have upto certain data. In a follow up task , I will maintain stream ack like you suggested and only retry writing the data that is not present in all nodes. |
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.
A major problem is the following line in StreamCommitWatcher.releaseBuffers(..)
bufferPool.remove(byteBuffer);
since it is super expensive. We need some way to avoid it. Thanks.
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamCommitWatcher.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamCommitWatcher.java
Outdated
Show resolved
Hide resolved
|
|
Actually, using == to compare ByteBuffer may not work since there are duplicated buffers. We need to create a new class. Let me think about it. |
We may create a new StreamBuffer as shown above. Then, we can use ==. Tried it with the current change. It seems working; please test it: https://issues.apache.org/jira/secure/attachment/13035081/StreamBuffer.patch |
(cherry picked from commit 2dc98b9839f22625ec78f3905b941cb444c82024)
(cherry picked from commit cb50698b13fb2c53a10a9d44b607d19e3806a9d0)
(cherry picked from commit 50cacaee7e829f693648c6701e33d7f912a7eced)
(cherry picked from commit 22fe01e98d7cfceefce36d27f4b5941478c7a3b3)
|
Thanks @szetszwo for the review comments. I have updated the patch. Will add more tests in a separate jira |
We are not comparing duplicated buffers here, since the same StreamBuffer object is present in bufferList and the commitInfoMap so we can use equals() and since its on the new StreamBuffer Class it will not compare every byte of the ByteBuffer if I am not wrong, |
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 , thanks for the update. Just a few minor comments inlined.
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamBuffer.java
Outdated
Show resolved
Hide resolved
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 latest change look good.
What changes were proposed in this pull request?
Handle client write retries on exception
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-5674
How was this patch tested?
Unit tests.