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


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java:
##########
@@ -1348,7 +1358,6 @@ public void markContainerUnhealthy(Container container, 
ScanResult reason)
     } finally {
       container.writeUnlock();
     }
-    createContainerMerkleTree(container);

Review Comment:
   If a container moves from `OPEN` to `UNHEALTHY` state we should try to build 
a merkle tree with whatever data we have at the moment before the scanner 
builds the actual merkle tree. If for some reason (either metadata/data error) 
we are unable to build it, then we can log the exception and move. 



##########
hadoop-ozone/dist/src/main/smoketest/admincli/container.robot:
##########
@@ -137,12 +138,11 @@ Close container
     Wait until keyword succeeds    1min    10sec    Container is closed    
${container}
 
 Reconcile closed container
-    # Check that info does not show replica checksums, since manual 
reconciliation has not yet been triggered.
-    # TODO When the scanner is computing checksums automatically, this test 
may need to be updated.
     ${container} =      Execute          ozone admin container list --state 
CLOSED | jq -r 'select(.replicationConfig.replicationFactor == "THREE") | 
.containerID' | head -1
     ${data_checksum} =  Execute          ozone admin container info 
"${container}" --json | jq -r '.replicas[].dataChecksum' | head -n1
-    # 0 is the hex value of an empty checksum.
-    Should Be Equal As Strings    0    ${data_checksum}
-    # When reconciliation finishes, replica checksums should be shown.
+    # Once the container is closed, the data checksum should be populated
+    Should Not Be Equal As Strings    0    ${data_checksum}
+    Container checksums should match    ${container}    ${data_checksum}
+    # Check that reconcile CLI returns success. Without fault injection, there 
is no change expected to the
+    # container's checksums to inidcate it made a difference

Review Comment:
   ```suggestion
       # container's checksums to indicate it made a difference
   ```



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java:
##########
@@ -379,12 +378,13 @@ private List<ContainerScanError> scanBlock(DBHandle db, 
File dbFile, BlockData b
           // So, we need to make sure, chunk length > 0, before declaring
           // the missing chunk file.
           if (!block.getChunks().isEmpty() && 
block.getChunks().get(0).getLen() > 0) {
-            ContainerScanError error = new 
ContainerScanError(FailureType.MISSING_CHUNK_FILE,
+            ContainerScanError error = new 
ContainerScanError(FailureType.MISSING_DATA_FILE,
                 new File(containerDataFromDisk.getChunksPath()), new 
IOException("Missing chunk file " +
                 chunkFile.getAbsolutePath()));
             blockErrors.add(error);
           }
         } else if (chunk.getChecksumData().getType() != 
ContainerProtos.ChecksumType.NONE) {
+          currentTree.addBlock(block.getBlockID().getLocalID());

Review Comment:
   Can we not add the block when we add the first chunk? 



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