kerneltime commented on a change in pull request #2542:
URL: https://github.com/apache/ozone/pull/2542#discussion_r690800501



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java
##########
@@ -595,6 +602,12 @@ ContainerCommandResponseProto handleReadChunk(
 
       data = chunkManager.readChunk(kvContainer, blockID, chunkInfo,
           dispatcherContext);
+      // Validate data only if the read chunk issued as a result of
+      // ratis call internally. For client reads, validation happens
+      // on the client

Review comment:
       ```suggestion
         // Validate data only if the read chunk is issued by Ratis for its 
internal logic.
         //  For client reads, the client is expected to validate.
   ```

##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java
##########
@@ -664,6 +677,18 @@ ContainerCommandResponseProto handleDeleteChunk(
     return getSuccessResponse(request);
   }
 
+  private void validateChunkData(ChunkBuffer data, ChunkInfo info)

Review comment:
       There can be many kinds of validations. This makes the code more 
readable in terms of what will be done.
   ```suggestion
     private void validateChunkChecksumData(ChunkBuffer data, ChunkInfo info)
   ```

##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeConfiguration.java
##########
@@ -214,6 +216,16 @@ public void setBlockDeletionLimit(int limit) {
   )
   private long diskCheckTimeout = DISK_CHECK_TIMEOUT_DEFAULT;
 
+  @Config(key = "chunk.data.validation.check",
+      defaultValue = "false",
+      type = ConfigType.BOOLEAN,
+      tags = { DATANODE },
+      description = "Enable safety checks to ensure chunk offset equal "
+          + "to block file length"

Review comment:
       ```suggestion
         description = "Enable safety checks such as checksum validation for 
Ratis calls."
   ```




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to