swamirishi commented on code in PR #5523:
URL: https://github.com/apache/ozone/pull/5523#discussion_r1380405453


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/EmptyContainerHandler.java:
##########
@@ -69,6 +69,21 @@ public boolean handle(ContainerCheckRequest request) {
       replicationManager.updateContainerState(
           containerInfo.containerID(), HddsProtos.LifeCycleEvent.DELETE);
       return true;
+    } else if (containerInfo.getState() == HddsProtos.LifeCycleState.CLOSED
+        && containerInfo.getNumberOfKeys() == 0 && replicas.isEmpty()) {
+      // If the container is empty and has no replicas, it is possible it was
+      // a container which stuck in the closing state which never got any
+      // replicas created on the datanodes. In this case, we don't have enough
+      // information to delete the container, so we just log it as EMPTY,
+      // leaving it as CLOSED and return true, otherwise, it will end up marked
+      // as missing in the replication check handlers.
+      request.getReport()
+          .incrementAndSample(ReplicationManagerReport.HealthState.EMPTY,
+              containerInfo.containerID());
+      LOG.debug("Container {} appears empty and is closed, but cannot be " +

Review Comment:
   Can this log be info level since the number of such containers will be in 
smaller proportion?



-- 
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]

Reply via email to