ashishkumar50 commented on code in PR #4684:
URL: https://github.com/apache/ozone/pull/4684#discussion_r1191149400
##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/health/TestClosingContainerHandler.java:
##########
@@ -210,6 +215,31 @@ public void
testClosingContainerStateIsUpdatedWhenThereAreNotReplicas() {
});
}
+ @Test
+ public void testEmptyContainerInClosingState() throws InterruptedException {
+ /*
+ * Empty Container in CLOSING state should be CLOSED after
+ * a timeout (ReplicationManager Interval * 5)
+ */
+ replicationManager.getConfig().setInterval(Duration.ofSeconds(1));
+ ContainerInfo containerInfo = ReplicationTestUtil.createContainerInfo(
+ RATIS_REPLICATION_CONFIG, 1, CLOSING);
+ Set<ContainerReplica> containerReplicas = new HashSet<>();
+ ReplicationManagerReport report = new ReplicationManagerReport();
+ ContainerCheckRequest request = new ContainerCheckRequest.Builder()
+ .setPendingOps(Collections.emptyList())
+ .setReport(report)
+ .setContainerInfo(containerInfo)
+ .setContainerReplicas(containerReplicas)
+ .build();
+
+ Thread.sleep(Duration.ofSeconds(5).toMillis());
Review Comment:
This issue can even reproduce in integration test
TestBlockDeletion::testContainerStatisticsAfterDelete. We can comment out
//out.write(value.getBytes(UTF_8)). In this case there is no replica and when
we close container using close container command, container remains in CLOSING
state always.
--
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]