adoroszlai commented on code in PR #11903:
URL: https://github.com/apache/ozone/pull/11903#discussion_r4561049413
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestContainerReconciliationWithMockDatanodes.java:
##########
@@ -311,6 +311,40 @@ public void
testContainerReconciliationWithPeerFailure(FailureLocation failureLo
mockContainerProtocolCalls();
}
+ @Test
+ public void
testContainerReconciliationVerifiesPeerDataWhenClientChecksumVerifyDisabled()
throws Exception {
+ long containerID = CONTAINER_ID + 2;
+ for (MockDatanode dn : datanodes) {
+ dn.addContainerWithBlocks(containerID, 5, false);
+ dn.scanContainer(containerID);
+ }
+ long healthyChecksum = assertUniqueChecksumCount(containerID, datanodes,
1);
+ MockDatanode laggingNode = datanodes.get(0);
+ MockDatanode corruptPeer = datanodes.get(1);
+ MockDatanode healthyPeer = datanodes.get(2);
+
+ laggingNode.introduceCorruption(containerID, 1, 0, false);
+ laggingNode.scanContainer(containerID);
+ // Corrupt the peer after its last scan so its Merkle tree still
advertises healthy data.
+ corruptPeer.introduceCorruption(containerID, 0, 1, false);
+
+ String verifyChecksumKey = "ozone.client.verify.checksum";
+ laggingNode.conf.setBoolean(verifyChecksumKey, false);
+ try {
+ laggingNode.reconcileContainerSuccess(dnClient,
+ Arrays.asList(corruptPeer.getDnDetails(),
healthyPeer.getDnDetails()), containerID);
+ } finally {
+ laggingNode.conf.unset(verifyChecksumKey);
+ }
+
+ // Reject the corrupt peer's bytes and repair from the healthy peer in the
same reconciliation task.
+ laggingNode.scanContainer(containerID);
+ assertEquals(healthyChecksum,
laggingNode.checkAndGetDataChecksum(containerID));
+ assertEquals(ContainerProtos.ContainerDataProto.State.CLOSED,
+ laggingNode.getContainer(containerID).getContainerData().getState());
+
Review Comment:
```suggestion
```
--
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]