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


##########
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:
   The log will be repeated each time RM runs, and we don't really know how 
many containers will fall into this situation. Keeping this as debug also keeps 
the pattern we have established across the rest of the new RM.



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