-
Notifications
You must be signed in to change notification settings - Fork 593
HDDS-9130. [hsync] Combine WriteData and PutBlock requests into one #5980
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-9130. [hsync] Combine WriteData and PutBlock requests into one #5980
Conversation
43b8acc to
0a0700b
Compare
0a0700b to
3f355e5
Compare
Rebased on HDDS-9752. Client side implementation. Change-Id: I4ff1c3148970edb8820a30dfda607a8aff3f7a52 incomplete server side impl. Change-Id: I3a52c931a4bd60a747ae47737f78df23046d1053 Passed TestHSync Change-Id: Ia70db6af5ed295fdb8fdc55b998a8233dc86c416 Fix bug. When write finishes a full chunk, the chunk is written to DataNode, but the currentChuk is not updated. Therefore, the flusher need to check if the chunk is full or not, and if full, skip writing chunk (because it is already written out). Change-Id: I8685b1894466ec7ebd1bc80c49809523dac4855e Remove debug messages. Change-Id: I6678899c7f03317ad5fbd02298e80dd534a3308a Fix tests and checkstyle Change-Id: I18363e9e3f8b0255adda4fcd40bde0929283256c Fix test Change-Id: Ic9765ee2ec1c15c4558d91380416604dea4f981e Fix counter Change-Id: Ifac56842f36bcca0bfd29d9da7873a98d36134e7 Add a new datanode version. Client do not piggyback PutBlock requests if datanode is not upgraded. Add DN version check Update checkstyle Fix configuration key problem. (cherry picked from commit 8ab02b7) Do not execute PutBlock in WRITE_DATA; only do it in COMMIT_DATA phase. Merge duplicate code. Checkstyle and refactory Fix bug Enable piggyback for the two tests. eckstyle
3f355e5 to
0a4ef7d
Compare
Change-Id: Ibdb80368b67248d2ca3d44bc6e4c6c756ee41852
Change-Id: I42fd82ccca3e871375acb5256a9da2ff913ab325
Change-Id: I3531fc4fe7d912300b1c02cca48a7e66f468faf0
ashishkumar50
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.
@jojochuang Thanks for the patch, Please find the comments inline.
| } | ||
| } else { | ||
| updateFlushLength(); | ||
| executePutBlock(close, false); |
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.
Whether PutBlock required here for small chunk?
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.
This is the typical case (no hflush) where a PutBlock is sent to update metadata after four 1-MB chunks are sent via WriteChunk requests)
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java
Outdated
Show resolved
Hide resolved
| if (config.getIncrementalChunkList()) { | ||
| // remove any chunks in the containerBlockData list. | ||
| // since they are sent. | ||
| containerBlockData.clearChunks(); |
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.
Do we need to remove last chunk as well here which is updated in updateBlockDataForWriteChunk in case of IncrementalChunkList?
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.
No --
lastChunk is used to calculate checksum in PutBlock (PutBlock contains metadata)
whereas containerBlockData is sent by WriteChunk (WriteChunk contains written data)
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java
Outdated
Show resolved
Hide resolved
Change-Id: Iec511ccf2a975c2cac0e76301bb0affb16df56dc
| KeyValue.newBuilder().setKey(FULL_CHUNK).build(); | ||
|
|
||
| // Flushed chunk less than 100KB will combine PutBlock and WriteChunk in the same request. | ||
| private static final int SMALL_CHUNK_THRESHOLD = 100 * 1024; |
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.
Can we make this configurable?
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/apache/hadoop/hdds/scm/protocolPB/ContainerCommandResponseBuilders.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java
Outdated
Show resolved
Hide resolved
| .writeChunk(kvContainer, blockID, chunkInfo, data, dispatcherContext); | ||
|
|
||
| final boolean isCommit = dispatcherContext.getStage().isCommit(); | ||
| if (isCommit && writeChunk.hasBlock()) { |
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.
Shall we check COMBINED_PUTBLOCK_WRITECHUNK_RPC is finalized here?
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.
COMBINED_PUTBLOCK_WRITECHUNK_RPC doesn't have the concept of "finalize". Once the runtime is updated, the datanode version becomes COMBINED_PUTBLOCK_WRITECHUNK_RPC.
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.
which should make sense because this PR does not change on-disk format.
Change-Id: Ic0928f7d57248496dd8596332d90db7312d4ad95
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java
Outdated
Show resolved
Hide resolved
Change-Id: I53ed73ca0611cacc387ddd5559f6bbd5d8dc1b17
|
Thanks. Updated. Those are good suggestions. |
ChenSammi
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.
The last patch LGTM. Thanks @jojochuang , and @ashishkumar50 for the review.
…pache#5980) (cherry picked from commit 91e5d2e)
What changes were proposed in this pull request?
Piggyback PutBlock in WriteChunk if the size to be flushed is small.
Please describe your PR in detail:
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9130
How was this patch tested?
Unit test, integration test. Manually tested on a real cluster.
Hsync throughput and latency has noticeable improvement with this patch.