-
Notifications
You must be signed in to change notification settings - Fork 511
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
HDDS-12007. BlockDataStreamOutput should only send one PutBlock during close. #7645
Conversation
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.
@ivandika3 , reverting the code can lead to an incompatible change. Currently, the client sends a PutBlock when closing the stream, and the server reads the PutBlock and processes it. If we revert HDDS-6500 and HDDS-6137, the new client won't send a PutBlock, then the old server will fail since it expects a PutBlock. The change in this PR is to ignore the PutBlock although the client still sends it. |
@szetszwo Thanks for the info.
Got it, in that case, shall we add some comments about the deprecation so that readers can see that the first However, eventually the client logic needs to be cleaned up. |
@szetszwo I have another question. Does |
@@ -689,29 +689,8 @@ public CompletableFuture<?> link(DataStream stream, LogEntryProto entry) { | |||
|
|||
final KeyValueStreamDataChannel kvStreamDataChannel = | |||
(KeyValueStreamDataChannel) dataChannel; | |||
|
|||
final ContainerCommandRequestProto request = |
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.
should we remove KeyValueStreamDataChannel#putBlockRequest
, KeyValueStreamDataChannel#buffers
and related code, if we remove PutBlock here ?
As I understand it, in order to create the PutBlockReques
, we keep a KeyValueStreamDataChannel#buffers
in memory, which guarantees that the buffers data will only be written at close
. If we remove the PutBlock
here, do we not need it anymore?
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.
@xichen01 , thanks for reviewing this!
Yes, the putBlockRequest
can be removed.
Unfortunately, we still need the buffers
since clients still send a putBlockRequest
. We need the buffers
so the request won't be written to the file as data.
sendForward is to send the stream header request using the async API. For Ozone, the request currently is a WriteChunk request but not a PutBlock request. See ozone/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java Lines 206 to 226 in ab29a55
In the future, we may combine WriteChunk and PutBlock as in HDDS-9130. |
Failure in acceptance (secure) is being fixed in #7668. |
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.
Thanks for the info. LGTM +1.
For Ozone, the request currently is a WriteChunk request but not a PutBlock request
Thank you for the info. Checking the code again seems that ContainerStateMachine#applyTransaction
is no-op since WriteChunk
sent has no data and the WriteStage
is COMMIT_DATA
. So maybe the sendForward
can be skipped in the future.
Thanks @szetszwo for the patch, @ivandika3, @xichen01 for the review. |
@ivandika3 , @xichen01 , thanks a lot for the review! @adoroszlai , thanks for helping out the tests and merging this! |
@ivandika3 , sendForward currently is to add a WritChunk transaction. In the future, you are right that we may be able to skip it or do something else. There are a few options:
|
What changes were proposed in this pull request?
Do not do putBlock in link(..). Otherwise,
What is the link to the Apache JIRA
HDDS-12007
How was this patch tested?
Using existing tests.