aswinshakil commented on code in PR #7490:
URL: https://github.com/apache/ozone/pull/7490#discussion_r2096300412
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandler.java:
##########
@@ -743,6 +795,20 @@ private static ContainerCommandRequestProto
createContainerRequest(
.build();
}
+ private KeyValueContainer addContainer(KeyValueHandler keyValueHandler,
ContainerLayoutVersion layoutVersion) {
Review Comment:
We can remove this as this is not being used anywhere
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/scanner/TestBackgroundContainerMetadataScannerIntegration.java:
##########
@@ -89,10 +95,16 @@ void testCorruptionDetected(TestContainerCorruptions
corruption)
long closedContainerID = writeDataThenCloseContainer();
Container<?> closedContainer = getDnContainer(closedContainerID);
assertEquals(State.CLOSED, closedContainer.getContainerState());
+ assertTrue(containerChecksumFileExists(closedContainerID));
+ waitForScmToSeeReplicaState(closedContainerID, CLOSED);
+ long initialClosedChecksum =
getContainerReplica(closedContainerID).getDataChecksum();
+ assertNotEquals(0, initialClosedChecksum);
long openContainerID = writeDataToOpenContainer();
Container<?> openContainer = getDnContainer(openContainerID);
assertEquals(State.OPEN, openContainer.getContainerState());
+ // Open containers should not yet have a checksum generated.
+ assertEquals(0, getContainerReplica(openContainerID).getDataChecksum());
Review Comment:
We should also wait for SCM to see the replica state as `OPEN`, similar to
line 99. If there are some timing issue this might throw an error if the SCM
hasn't seen the replica.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java:
##########
@@ -1394,11 +1368,97 @@ public void markContainerForClose(Container container)
} finally {
container.writeUnlock();
}
- createContainerMerkleTreeFromMetadata(container);
+ updateContainerChecksumFromMetadataIfNeeded(container);
ContainerLogger.logClosing(container.getContainerData());
sendICR(container);
}
+ @Override
+ public void updateContainerChecksum(Container container,
ContainerMerkleTreeWriter treeWriter)
Review Comment:
We should rename it to indicate that it sends ICR, which is what
distinguishes it from the other update checksum functions.
```suggestion
public void updateContainerChecksumAndSendICR(Container container,
ContainerMerkleTreeWriter treeWriter)
```
--
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]