-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-9751. [hsync] Make Putblock performance acceptable - DataNode side #5662
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
f90b557 to
f9db199
Compare
5e2b3c0 to
51247a2
Compare
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 my comments.
| String blockKey = containerData.getBlockKey(blockID.getLocalID()); | ||
|
|
||
| // check last chunk table | ||
| BlockData lastChunk = getLastChunkInfoTable().get(blockKey); |
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.
If incremental is disabled we can avoid calling getLastChunkInfoTable().
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.
good idea.
...-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreSchemaThreeImpl.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreSchemaThreeImpl.java
Outdated
Show resolved
Hide resolved
| // update the last partial chunk | ||
| data.setChunks(lastChunkInfo); | ||
| getLastChunkInfoTable().putWithBatch( | ||
| batch, containerData.getBlockKey(localID), data); |
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 just define and store the last chunk instead of blockData containing last 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.
i think there could still be cases where the client's buffer has more than one chunk's full of data that gets flushed out at a time.
hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockDatanodeStorage.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreSchemaThreeImpl.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockXceiverClientSpi.java
Outdated
Show resolved
Hide resolved
|
|
||
| @Test | ||
| public void testFlush1() throws Exception { | ||
| assumeTrue(isSameSchemaVersion(schemaVersion, OzoneConsts.SCHEMA_V3)); |
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.
Since SCHEMA_V2 is also supported. We can use parameterized test to test both SCHEMA_V3 and SCHEMA_V2.
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 it in another way: skip if schema is v1.
| // if eob or if the last chunk is full, | ||
| private static boolean shouldAppendLastChunk(boolean endOfBlock, | ||
| BlockData data) { | ||
| if (endOfBlock || data.getChunks().isEmpty()) { |
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.
In what case that the data.getChunks will be empty?
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.
hsync right after creating a file might cause client to send empty 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.
I see.
...vice/src/test/java/org/apache/hadoop/ozone/container/keyvalue/impl/TestBlockManagerImpl.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockDatanodeStorage.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockDatanodeStorage.java
Outdated
Show resolved
Hide resolved
|
@jojochuang , for other cases like block deletion, container deletion, and container replica, will you file other JIRAs to support the incremental list table handling? |
|
Yes HDDS-9753 is the catch-all for handling incremental chunk lists in other operations. |
Change-Id: Ie9201f2ddc288320fde6f8931af1edc3dd220bb7 Mock helper methods. Change-Id: I07399ff1f18a9a3a1d5e147e0a8b57cf7d3dd949 Add Mock storage Change-Id: Ib7413af4e531e5e083292a7a2ab08826fc4ba64a Fix compilation error Checkstyle Fix (cherry picked from commit 51247a2) Address review comments. Review comments. Address Ashish's comments.
| return blockData; | ||
| } | ||
|
|
||
| @ContainerTestVersionInfo.ContainerTest |
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.
When using @ContainerTestVersionInfo.ContainerTest, the test shall have a "ContainerTestVersionInfo versionInfo" parameter, otherwise, the parameterized test is not actually enabled.
@ContainerTestVersionInfo.ContainerTest public void testPendingDeleteBlockReset(ContainerTestVersionInfo versionInfo)
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.
Great catch! And I actually realized I had to move the code to a shared class so that both v2 and v3 can support this feature.
Added another middle layer to share the code common to schema v2 and schema v3.
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 looks good. Thanks @jojochuang
|
Thanks @ChenSammi for the review! |
What changes were proposed in this pull request?
Implement DataNode side change for HDDS-8047 incremental chunk list for PutBlock. See HDDS-8047 for the problem description and design doc.
Please describe your PR in detail:
PutBlock metadata optimization.pdf
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9751
How was this patch tested?