GeorgeJahad commented on code in PR #3947:
URL: https://github.com/apache/ozone/pull/3947#discussion_r1046296202
##########
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:
Is this line needed? The scmContainerCount shouldn't have changed, should
it?
--
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]