You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/08/17 11:34:03 UTC

[GitHub] [ozone] adoroszlai commented on a change in pull request #2463: HDDS-5483. Validate block file length during put block

adoroszlai commented on a change in pull request #2463:
URL: https://github.com/apache/ozone/pull/2463#discussion_r690283532



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java
##########
@@ -460,6 +463,20 @@ ContainerCommandResponseProto handlePutBlock(
       ContainerProtos.BlockData data = request.getPutBlock().getBlockData();
       BlockData blockData = BlockData.getFromProtoBuf(data);
       Preconditions.checkNotNull(blockData);
+      ChunkLayOutVersion layoutVersion =
+          ChunkLayOutVersion.getConfiguredVersion(conf);
+      if (layoutVersion == FILE_PER_BLOCK &&
+          // ChunkManagerDummyImpl doesn't persist to disk, don't check here
+          !chunkManager.getClass()
+              .isAssignableFrom(ChunkManagerDummyImpl.class)) {

Review comment:
       I think layout-specific code would be better added to each `ChunkManager` implementation instead of such `if` and `isAssignableFrom`.  Take a look at `finishWriteChunks()` and `shutdown()`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org