You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ashishkumar50 (via GitHub)" <gi...@apache.org> on 2023/05/11 13:03:30 UTC

[GitHub] [ozone] ashishkumar50 commented on a diff in pull request #4684: HDDS-7882. Delete empty containers that are stuck in CLOSING state.

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org