aswinshakil commented on code in PR #8565:
URL: https://github.com/apache/ozone/pull/8565#discussion_r2193023842


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/checksum/ContainerChecksumTreeManager.java:
##########
@@ -290,8 +275,8 @@ private void 
compareBlockMerkleTree(ContainerProtos.BlockMerkleTree thisBlockMer
         // thisTree = Healthy, peerTree = unhealthy -> Do nothing as thisTree 
is healthy.
         // thisTree = Unhealthy, peerTree = Unhealthy -> Do Nothing as both 
are corrupt.
         if (thisChunkMerkleTree.getDataChecksum() != 
peerChunkMerkleTree.getDataChecksum() &&
-            !thisChunkMerkleTree.getChecksumMatches() && 
peerChunkMerkleTree.getChecksumMatches()) {
-          report.addCorruptChunk(peerBlockMerkleTree.getBlockID(), 
peerChunkMerkleTree);
+            !thisChunkMerkleTree.getChecksumMatches()) {
+          reportChunkIfHealthy(containerID, blockID, 
peerChunkMerkleTreeList.get(peerIdx), report::addCorruptChunk);

Review Comment:
   Can we use `peerChunkMerkleTree` from line 269, We can avoid another get 
operation here. 



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/checksum/ContainerChecksumTreeManager.java:
##########
@@ -301,30 +286,33 @@ private void 
compareBlockMerkleTree(ContainerProtos.BlockMerkleTree thisBlockMer
         thisIdx++;
       } else {
         // Peer chunk's offset is smaller; record missing chunk and advance 
peerIdx
-        report.addMissingChunk(peerBlockMerkleTree.getBlockID(), 
peerChunkMerkleTree);
+        reportChunkIfHealthy(containerID, blockID, 
peerChunkMerkleTreeList.get(peerIdx), report::addMissingChunk);

Review Comment:
   Same as above.



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