GeorgeJahad commented on code in PR #3947:
URL: https://github.com/apache/ozone/pull/3947#discussion_r1047547419
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java:
##########
@@ -89,6 +90,42 @@ public void shutdown() {
}
}
+ @Test
+ public void testSyncSCMContainerInfo() throws Exception {
+ ReconStorageContainerManagerFacade reconScm =
+ (ReconStorageContainerManagerFacade)
+ cluster.getReconServer().getReconStorageContainerManager();
+ StorageContainerManager scm = cluster.getStorageContainerManager();
+ ContainerManager scmContainerManager = scm.getContainerManager();
+ ContainerManager reconContainerManager = reconScm.getContainerManager();
+ final ContainerInfo container1 = scmContainerManager.allocateContainer(
+ RatisReplicationConfig.getInstance(
+ HddsProtos.ReplicationFactor.ONE), "admin");
+ final ContainerInfo container2 = scmContainerManager.allocateContainer(
+ RatisReplicationConfig.getInstance(
+ HddsProtos.ReplicationFactor.ONE), "admin");
+ reconContainerManager.allocateContainer(
+ RatisReplicationConfig.getInstance(
+ HddsProtos.ReplicationFactor.ONE), "admin");
+ scmContainerManager.updateContainerState(container1.containerID(),
+ HddsProtos.LifeCycleEvent.FINALIZE);
+ scmContainerManager.updateContainerState(container2.containerID(),
+ HddsProtos.LifeCycleEvent.FINALIZE);
+ scmContainerManager.updateContainerState(container1.containerID(),
+ HddsProtos.LifeCycleEvent.CLOSE);
+ scmContainerManager.updateContainerState(container2.containerID(),
+ HddsProtos.LifeCycleEvent.CLOSE);
+ int scmContainersCount = scmContainerManager.getContainers().size();
+ int reconContainersCount = reconContainerManager
+ .getContainers().size();
+ Assert.assertNotEquals(scmContainersCount, reconContainersCount);
+ reconScm.syncWithSCMContainerInfo();
+ scmContainersCount = scmContainerManager.getContainers().size();
Review Comment:
But line 122: " reconScm.syncWithSCMContainerInfo();" only changes the
reconContainersCount, not the scmContainersCount.
So line 123 is unnecessary, and confusing, because it makes it seem like
syncWithSCMContainerInfo() changes scmContainersCount, but it doesn't.
Isn't that correct? or am I misunderstanding something?
--
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]