Skip to content

Conversation

@jojochuang
Copy link
Contributor

What changes were proposed in this pull request?

HDDS-10904. [hsync] Enable PutBlock piggybacking and incremental chunk list by default

Please describe your PR in detail:

  • Enable WriteChunk/PutBlock piggybacking (ozone.client.stream.putblock.piggybacking) by default (HDDS-9130)
  • Enable incremental chunk list feature (ozone.client.incremental.chunk.list) by default (HDDS-8047)
  • Disable both features if the DataNode protocol version is older (below COMBINED_PUTBLOCK_WRITECHUNK_RPC/2)
  • Deal with empty block case for EC in the DataNode blockDataTable.
  • Deal with Ratis client corner case where before a block becomes at least a full chunk long, it may not be found by various utilities (delete block, container inspector,

What is the link to the Apache JIRA

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

How was this patch tested?

Existing unit tests, acceptance compatibility test, new unit tests for empty chunk case.

@jojochuang jojochuang added the hbase HBase on Ozone support label Aug 14, 2024
@jojochuang jojochuang marked this pull request as ready for review August 15, 2024 00:37
@jojochuang jojochuang requested a review from smengcl August 15, 2024 00:37
cData.containerPrefix(), cData.getUnprefixedKeyFilter());
for (Table.KeyValue<String, BlockData> entry : range) {
result.add(entry.getValue());
result.add(db.getStore().getBlockByID(null, entry.getKey()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why should we get the blockData from blockDataTable again after getting a range of blockData from blockDataTable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If incremental chunk list feature is enabled, the last chunk of a block may exist in the lastChunkInfoTable. So getBlockByID() is used here to get the complete block data.

There could be opportunities to optimize later.

Copy link
Contributor

@chungen0126 chungen0126 Aug 15, 2024

Choose a reason for hiding this comment

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

Can we put merging the last chunk into another function? For example:

  @Override
  public BlockData getBlockByID(BlockID blockID,
      String blockKey) throws IOException {
    // check block data table
    BlockData blockData = getBlockDataTable().get(blockKey);
    return getCompleteBlockData(blockData, blockID, blockKey);
  }

  @Override
  public BlockData getCompleteBlockData(
      BlockData blockData, BlockID blockID, String blockKey) throws IOException {
    BlockData lastChunk = null;
    if (blockData == null || isPartialChunkList(blockData)) {
      // check last chunk table
      lastChunk = getLastChunkInfoTable().get(blockKey);
    }

    if (blockData == null || blockData.getChunks().isEmpty()) {
      if (lastChunk == null) {
        throw new StorageContainerException(
            NO_SUCH_BLOCK_ERR_MSG + " BlockID : " + blockID, NO_SUCH_BLOCK);
      } else {
        if (LOG.isDebugEnabled()) {
          LOG.debug("blockData=(null), lastChunk={}", lastChunk.getChunks());
        }
        return lastChunk;
      }
    } else {
      if (lastChunk != null) {
        reconcilePartialChunks(lastChunk, blockData);
      } else {
        if (LOG.isDebugEnabled()) {
          LOG.debug("blockData={}, lastChunk=(null)", blockData.getChunks());
        }
      }
    }

    return blockData;
  }

Then, we can use it here, and we can avoid getting blockData from the table twice.

for (Table.KeyValue<String, BlockData> entry : range) {
          result.add(db.getStore().getCompleteBlockData(entry.getValue(), null, entry.getKey()));
        }
        return result;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! That makes sense to me.

Change-Id: Ie3b32970080cbb262a7f646f787218f69ad29299

Remove redundant change.

Change-Id: Ife4677c818ea2e9d4ad4c9547257d1d2150a88b7

Disable incremental chunk list feature for EC block outputstream.

Change-Id: Ifa530651f67ff4d0da0903e67968c9a3fc18384a

Update

Change-Id: I31c03bfbc866cc0bf7672c252d3dee98a32a7234

Fix test bugs.

Change-Id: I19ad8b4a2adbd755250adafcd02065ae297e360b

Checkstyle

Change-Id: I4f506cf6ddacab4328ca2d6a97ec4aeb0ea108a5

Fix test failures.

Change-Id: I6d80b7f468e535f69453291717f371060b3a5e71

Backward compatibility support

Change-Id: I5213e761acd9beaecb2f72ca7de1b8acfa573624

Fix NPE

Change-Id: I93962304ae35e58fd412150f0ea4476e31001465

Fix TestBlockDeletion.

Change-Id: Ic2b5273371bff432a8e8260e9259d2f2f7894aac

Fix TestDeleteContainerHandler.testDeleteContainerRequestHandlerOnClosedContainer()

Change-Id: I0498f2690a58d9a23c3c9afb5bbcafd9e921176c

Fix bug

Change-Id: I7a919906544de3687bca120d9da0a100d99c0472

Fix more getBlockDataTable usage.

Change-Id: I0bb0f20691f6c1fea5a783a0a090c6f21d87cb7e
Change-Id: Ia19a9ea98ff8acdb14e02548b85de1568b9c1339
Change-Id: Iece7b934d15b8657650a6d7c2d487eb1738e4355
…re in TestKeyValueContainer.

Change-Id: I38025e700ec04e31a9a22dcd74b9d131e1ff60c5
Change-Id: I0d1eccac12b1c6deb7769998aa4221ce4f0cb79b
Change-Id: I92fb4a7f5b03b9ad44e2065a5d2b17c423956ddc
Change-Id: Id3dcb5794f2a9c59b2f96cf136ed0f178da15632
Change-Id: I18d85e7c2c24888815323ef6f6deef550039536f
Change-Id: I8145f4b1c0e48fb9c6533f4f03ddbba624ab3410

Simplify tets

Change-Id: I4e0b35e85d3c91dac160fdcc365142134846fb5d

Simplify more.

Change-Id: I46a3ee1026fd1cafa4a91e07e3d209afc053b014

Pack/unpack last chunk info table in container only after finalization.

Change-Id: I9bb832f8ec356f73788123eb3c6918836d80e0d0

Remove unused parameters.

Change-Id: If6d4cdf04581092089dc7d455b5e387209cb804c
This reverts commit ac356e3.

Change-Id: I98d2020f1ca8d8f6b37dd38a062e10ed470264af
…ned.

Change-Id: I6c6e681f3b83e404bfeed5f383a45ce2b778561c
Change-Id: Ic5126a535bb6aee9f87bcea4889b957241cf94e9
Change-Id: I13d6f5621ba168e456bdd20c43e409678657b3aa
@jojochuang jojochuang requested a review from chungen0126 August 19, 2024 20:41
if (datanodeDetailsProto.hasCurrentVersion()) {
builder.setCurrentVersion(datanodeDetailsProto.getCurrentVersion());
} else {
// fallback to version 1 if not present
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to remove this fallback branch since it's not sure about the DN's version.

Copy link
Contributor Author

@jojochuang jojochuang Aug 20, 2024

Choose a reason for hiding this comment

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

The thing is if it is not set, it is automatically set to the client's current datanode version, which is 2. So the client wouldn't be able to tell the correct DataNode version.

Change-Id: Ia6ffa083da3730b4fcad814ba6de63e3aad40dc1
Copy link
Contributor Author

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

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

Simplified the PR. Turns out there's no need to handle the EC empty block corner case.

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 LGTM. Thanks @jojochuang .

@jojochuang jojochuang merged commit 624bede into apache:master Aug 21, 2024
@jojochuang
Copy link
Contributor Author

Merged. Thanks @ChenSammi and @chungen0126 !

errose28 added a commit to errose28/ozone that referenced this pull request Aug 21, 2024
* master: (50 commits)
  HDDS-11331. Fix Datanode unable to report for a long time (apache#7090)
  HDDS-11346. FS CLI gives incorrect recursive volume deletion prompt (apache#7102)
  HDDS-11349. Add NullPointer handling when volume/bucket tables are not initialized (apache#7103)
  HDDS-11209. Avoid insufficient EC pipelines in the container pipeline cache (apache#6974)
  HDDS-11284. refactor quota repair non-blocking while upgrade (apache#7035)
  HDDS-9790. Add tests for Overview page (apache#6983)
  HDDS-10904. [hsync] Enable PutBlock piggybacking and incremental chunk list by default (apache#7074)
  HDDS-11322. [hsync] Block ECKeyOutputStream from calling hsync and hflush (apache#7098)
  HDDS-11325. Intermittent failure in TestBlockOutputStreamWithFailures#testContainerClose (apache#7099)
  HDDS-11340. Avoid extra PubBlock call when a full block is closed (apache#7094)
  HDDS-11155. Improve Volumes page UI (apache#7048)
  HDDS-11324. Negative value preOpLatencyMs in DN audit log (apache#7093)
  HDDS-11246. [Recon] Use optional chaining instead of explicit undefined check for Objects in Container and Pipeline Module. (apache#7037)
  HDDS-11323. Mark TestLeaseRecovery as flaky
  HDDS-11338. Bump zstd-jni to 1.5.6-4 (apache#7085)
  HDDS-11337. Bump Spring Framework to 5.3.39 (apache#7084)
  HDDS-11327. [hsync] Revert config default ozone.fs.hsync.enabled to false (apache#7079)
  HDDS-11325. Mark testWriteMoreThanMaxFlushSize as flaky
  HDDS-11336. Bump slf4j to 2.0.16 (apache#7086)
  HDDS-11335. Bump exec-maven-plugin to 3.4.1 (apache#7087)
  ...

Conflicts:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeConfiguration.java
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java
errose28 added a commit to errose28/ozone that referenced this pull request Aug 21, 2024
* master: (50 commits)
  HDDS-11331. Fix Datanode unable to report for a long time (apache#7090)
  HDDS-11346. FS CLI gives incorrect recursive volume deletion prompt (apache#7102)
  HDDS-11349. Add NullPointer handling when volume/bucket tables are not initialized (apache#7103)
  HDDS-11209. Avoid insufficient EC pipelines in the container pipeline cache (apache#6974)
  HDDS-11284. refactor quota repair non-blocking while upgrade (apache#7035)
  HDDS-9790. Add tests for Overview page (apache#6983)
  HDDS-10904. [hsync] Enable PutBlock piggybacking and incremental chunk list by default (apache#7074)
  HDDS-11322. [hsync] Block ECKeyOutputStream from calling hsync and hflush (apache#7098)
  HDDS-11325. Intermittent failure in TestBlockOutputStreamWithFailures#testContainerClose (apache#7099)
  HDDS-11340. Avoid extra PubBlock call when a full block is closed (apache#7094)
  HDDS-11155. Improve Volumes page UI (apache#7048)
  HDDS-11324. Negative value preOpLatencyMs in DN audit log (apache#7093)
  HDDS-11246. [Recon] Use optional chaining instead of explicit undefined check for Objects in Container and Pipeline Module. (apache#7037)
  HDDS-11323. Mark TestLeaseRecovery as flaky
  HDDS-11338. Bump zstd-jni to 1.5.6-4 (apache#7085)
  HDDS-11337. Bump Spring Framework to 5.3.39 (apache#7084)
  HDDS-11327. [hsync] Revert config default ozone.fs.hsync.enabled to false (apache#7079)
  HDDS-11325. Mark testWriteMoreThanMaxFlushSize as flaky
  HDDS-11336. Bump slf4j to 2.0.16 (apache#7086)
  HDDS-11335. Bump exec-maven-plugin to 3.4.1 (apache#7087)
  ...

Conflicts:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeConfiguration.java
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java
errose28 added a commit to errose28/ozone that referenced this pull request Aug 26, 2024
…an-on-error

* HDDS-10239-container-reconciliation: (428 commits)
  HDDS-11081. Use thread-local instance of FileSystem in Freon tests (apache#7091)
  HDDS-11333. Avoid hard-coded current version in upgrade/xcompat tests (apache#7089)
  Mark TestPipelineManagerMXBean#testPipelineInfo as flaky
  Mark TestAddRemoveOzoneManager#testForceBootstrap as flaky
  HDDS-11352. HDDS-11353. Mark TestOzoneManagerHAWithStoppedNodes as flaky
  HDDS-11354. Mark TestOzoneManagerSnapshotAcl#testLookupKeyWithNotAllowedUserForPrefixAcl as flaky
  HDDS-11355. Mark TestMultiBlockWritesWithDnFailures#testMultiBlockWritesWithIntermittentDnFailures as flaky
  HDDS-11227. Use server default key provider to encrypt/decrypt keys from multiple OMs. (apache#7081)
  HDDS-11316. Improve Create Key and Chunk IO Dashboards (apache#7075)
  HDDS-11239. Fix KeyOutputStream's exception handling when calling hsync concurrently (apache#7047)
  HDDS-11254. Reconcile commands should be handled by datanode ReplicationSupervisor (apache#7076)
  HDDS-11331. Fix Datanode unable to report for a long time (apache#7090)
  HDDS-11346. FS CLI gives incorrect recursive volume deletion prompt (apache#7102)
  HDDS-11349. Add NullPointer handling when volume/bucket tables are not initialized (apache#7103)
  HDDS-11209. Avoid insufficient EC pipelines in the container pipeline cache (apache#6974)
  HDDS-11284. refactor quota repair non-blocking while upgrade (apache#7035)
  HDDS-9790. Add tests for Overview page (apache#6983)
  HDDS-10904. [hsync] Enable PutBlock piggybacking and incremental chunk list by default (apache#7074)
  HDDS-11322. [hsync] Block ECKeyOutputStream from calling hsync and hflush (apache#7098)
  HDDS-11325. Intermittent failure in TestBlockOutputStreamWithFailures#testContainerClose (apache#7099)
  ...

Conflicts:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/checksum/ContainerChecksumTreeManager.java
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java
errose28 added a commit to errose28/ozone that referenced this pull request Aug 28, 2024
…rrupt-files

* HDDS-10239-container-reconciliation: (61 commits)
  HDDS-11081. Use thread-local instance of FileSystem in Freon tests (apache#7091)
  HDDS-11333. Avoid hard-coded current version in upgrade/xcompat tests (apache#7089)
  Mark TestPipelineManagerMXBean#testPipelineInfo as flaky
  Mark TestAddRemoveOzoneManager#testForceBootstrap as flaky
  HDDS-11352. HDDS-11353. Mark TestOzoneManagerHAWithStoppedNodes as flaky
  HDDS-11354. Mark TestOzoneManagerSnapshotAcl#testLookupKeyWithNotAllowedUserForPrefixAcl as flaky
  HDDS-11355. Mark TestMultiBlockWritesWithDnFailures#testMultiBlockWritesWithIntermittentDnFailures as flaky
  HDDS-11227. Use server default key provider to encrypt/decrypt keys from multiple OMs. (apache#7081)
  HDDS-11316. Improve Create Key and Chunk IO Dashboards (apache#7075)
  HDDS-11239. Fix KeyOutputStream's exception handling when calling hsync concurrently (apache#7047)
  HDDS-11254. Reconcile commands should be handled by datanode ReplicationSupervisor (apache#7076)
  HDDS-11331. Fix Datanode unable to report for a long time (apache#7090)
  HDDS-11346. FS CLI gives incorrect recursive volume deletion prompt (apache#7102)
  HDDS-11349. Add NullPointer handling when volume/bucket tables are not initialized (apache#7103)
  HDDS-11209. Avoid insufficient EC pipelines in the container pipeline cache (apache#6974)
  HDDS-11284. refactor quota repair non-blocking while upgrade (apache#7035)
  HDDS-9790. Add tests for Overview page (apache#6983)
  HDDS-10904. [hsync] Enable PutBlock piggybacking and incremental chunk list by default (apache#7074)
  HDDS-11322. [hsync] Block ECKeyOutputStream from calling hsync and hflush (apache#7098)
  HDDS-11325. Intermittent failure in TestBlockOutputStreamWithFailures#testContainerClose (apache#7099)
  ...

Conflicts:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/checksum/ContainerChecksumTreeManager.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hbase HBase on Ozone support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants