-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-9752. [hsync] Make Putblock performance acceptable - Client side #5663
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
148b2e4 to
71285f1
Compare
ee88612 to
ee220ab
Compare
1859bb8 to
4d36522
Compare
| KeyValue.newBuilder().setKey(INCREMENTAL_CHUNK_LIST).build(); | ||
| public static final String FULL_CHUNK = "full"; | ||
| public static final KeyValue FULL_CHUNK_KV = | ||
| KeyValue.newBuilder().setKey(FULL_CHUNK).build(); |
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 you put INCREMENTAL_CHUNK_LIST, FULL_CHUNK in some common places. I remember there is one definition too in BlockManagerImpl.
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 FULL_CHUNK_KV metadata is not welly put on chunks with full content, which cause the datanode putBlockByID process the blockData incorrectly.
| CONF.setBoolean(OZONE_OM_RATIS_ENABLE_KEY, false); | ||
| CONF.set(OZONE_DEFAULT_BUCKET_LAYOUT, layout.name()); | ||
| CONF.setBoolean(OzoneConfigKeys.OZONE_FS_HSYNC_ENABLED, true); | ||
| CONF.setBoolean("ozone.client.incremental.chunk.list", true); |
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 , we have OZONE_CHUNK_LIST_INCREMENTAL "ozone.chunk.list.incremental" to control the Datanode, and "ozone.client.incremental.chunk.list" to control the client. In long term I think the datanode side incremental chunk list shall be by default supported.
And here the "chunk.list.incremental" and "incremental.chunk.list" are used, can we just use one of them, maybe "incremental.chunk.list" ?
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 had to make it false by default to pass compatibility tests.
Ideally, a new client would detect DataNode version and then fallback to full chunk list. However, due to https://issues.apache.org/jira/browse/HDDS-9884, this is currently not possible and compat test would fail.
I can revisit this after HDDS-9884 is fixed.
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.
Filed HDDS-10252 to track this task.
| ReplicationConfig.getDefault(config), new HashMap<>())) { | ||
| for (int i = 0; i < 4097; i++) { | ||
| out.write(byteBuffer); | ||
| out.hsync(); |
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 is not enabled in this test. So the hsync call just fallback to flush call, which will call writeChunk and putBlock on the 4M boundary.
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 catch and realized we need to enable the flag in TestHSync too.
| try (OzoneInputStream is = bucket.readKey(keyName)) { | ||
| ByteBuffer readBuffer = ByteBuffer.allocate(size); | ||
| for (int i = 0; i < 4; i++) { | ||
| is.read(readBuffer); |
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 added one check here, it failed
int readLen = is.read(readBuffer);
assertEquals(bufferSize, readLen);
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 you use a MiniOzoneCluster to test the function. I'm afraid that this MockXceiverClientFactory cannot fully test the integration of client side and DN side code.
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.
TestHsync uses MiniOzoneCluster to test so that aspect is covered.
For this particular test file, part of the desire was to complete the unit test framework.
Change-Id: I2f5d42e02401b125694552c94541d19f2adca53c Add missing test cases. Change-Id: Ida6c78c35baa8a6665a4e7a0d99f57a9841b64aa Fix compilation error. Checkstyle Checkstyle Fix tests using the correct JUnit 5 semantics. (cherry picked from commit 2443c5f416aa173015357d148bc11b4bb11eb066) Checkstyle Fix test and checkstyle
|
@ashishkumar50 please review |
...t/src/test/java/org/apache/hadoop/ozone/client/TestBlockOutputStreamIncrementalPutBlock.java
Outdated
Show resolved
Hide resolved
...t/src/test/java/org/apache/hadoop/ozone/client/TestBlockOutputStreamIncrementalPutBlock.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
|
Thanks @jojochuang for update the patch. Could you check the failed TestBlockManagerImpl? Looks relevant. |
(cherry picked from commit 2938b69)
|
Yes -- turns out that the test needs to enable ozone.chunk.list.incremental |
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.
LGTM +1, thanks @jojochuang .
|
Thanks @ChenSammi merged. Thanks @ashishkumar50 too! |
…ent side (apache#5663)" This reverts commit 76a573a.
What changes were proposed in this pull request?
Implement Client 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 for implementation details.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9752
How was this patch tested?