Skip to content

Conversation

@jojochuang
Copy link
Contributor

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:

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9752

How was this patch tested?

  • New unit tests TestBlockOutputStreamIncrementalPutBlock
  • Full cluster HBase ycsb workload test

@jojochuang jojochuang requested a review from ChenSammi November 22, 2023 20:16
@jojochuang jojochuang changed the title Hdds 9752 HDDS-9752. [hsync] Make Putblock performance acceptable - Client side Nov 22, 2023
@jojochuang jojochuang force-pushed the HDDS-9752 branch 5 times, most recently from 148b2e4 to 71285f1 Compare December 21, 2023 19:08
@jojochuang jojochuang force-pushed the HDDS-9752 branch 3 times, most recently from ee88612 to ee220ab Compare January 5, 2024 04:48
@jojochuang jojochuang marked this pull request as ready for review January 5, 2024 19:03
@jojochuang jojochuang force-pushed the HDDS-9752 branch 2 times, most recently from 1859bb8 to 4d36522 Compare January 23, 2024 18:35
@jojochuang jojochuang added the hbase HBase on Ozone support label Jan 23, 2024
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();
Copy link
Contributor

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.

Copy link
Contributor

@ChenSammi ChenSammi Jan 26, 2024

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);
Copy link
Contributor

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" ?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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();
Copy link
Contributor

@ChenSammi ChenSammi Jan 26, 2024

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.

Copy link
Contributor Author

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);
Copy link
Contributor

@ChenSammi ChenSammi Jan 26, 2024

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);

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@jojochuang jojochuang requested a review from ChenSammi January 30, 2024 22:09
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
@jojochuang
Copy link
Contributor Author

@ashishkumar50 please review

@ChenSammi
Copy link
Contributor

Thanks @jojochuang for update the patch. Could you check the failed TestBlockManagerImpl? Looks relevant.

@jojochuang
Copy link
Contributor Author

Yes -- turns out that the test needs to enable ozone.chunk.list.incremental

Copy link
Contributor

@ChenSammi ChenSammi left a 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 .

@jojochuang jojochuang merged commit 76a573a into apache:HDDS-7593 Feb 7, 2024
@jojochuang
Copy link
Contributor Author

Thanks @ChenSammi merged. Thanks @ashishkumar50 too!

jojochuang added a commit to jojochuang/ozone that referenced this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hbase HBase on Ozone support performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants