Skip to content

Conversation

@jojochuang
Copy link
Contributor

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:

What is the link to the Apache JIRA

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

How was this patch tested?

  • New unit tests in TestBlockManagerImpl
  • Full cluster HBase ycsb workload test

@jojochuang jojochuang requested a review from ChenSammi November 22, 2023 20:08
@jojochuang jojochuang force-pushed the HDDS-9751 branch 3 times, most recently from f90b557 to f9db199 Compare December 21, 2023 19:06
@jojochuang jojochuang force-pushed the HDDS-9751 branch 4 times, most recently from 5e2b3c0 to 51247a2 Compare January 5, 2024 04:42
@jojochuang jojochuang marked this pull request as ready for review January 5, 2024 19:03
Copy link
Contributor

@ashishkumar50 ashishkumar50 left a 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);
Copy link
Contributor

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().

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 idea.

// update the last partial chunk
data.setChunks(lastChunkInfo);
getLastChunkInfoTable().putWithBatch(
batch, containerData.getBlockKey(localID), data);
Copy link
Contributor

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.

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 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.


@Test
public void testFlush1() throws Exception {
assumeTrue(isSameSchemaVersion(schemaVersion, OzoneConsts.SCHEMA_V3));
Copy link
Contributor

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.

Copy link
Contributor Author

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

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?

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

@ChenSammi
Copy link
Contributor

@jojochuang , for other cases like block deletion, container deletion, and container replica, will you file other JIRAs to support the incremental list table handling?

@jojochuang
Copy link
Contributor Author

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

@ChenSammi ChenSammi Jan 22, 2024

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)

Copy link
Contributor Author

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.
@jojochuang jojochuang requested a review from ChenSammi January 23, 2024 09:01
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.

The last patch looks good. Thanks @jojochuang

@jojochuang jojochuang merged commit 305a176 into apache:HDDS-7593 Jan 23, 2024
@jojochuang
Copy link
Contributor Author

Thanks @ChenSammi for the review!

@jojochuang jojochuang added the hbase HBase on Ozone support label Jan 23, 2024
chungen0126 pushed a commit to chungen0126/ozone that referenced this pull request May 3, 2024
chungen0126 pushed a commit to chungen0126/ozone that referenced this pull request May 3, 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