aswinshakil commented on a change in pull request #2548:
URL: https://github.com/apache/ozone/pull/2548#discussion_r692493295



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerController.java
##########
@@ -79,9 +84,18 @@ public String getContainerLocation(final long containerId) {
   public void markContainerForClose(final long containerId)
       throws IOException {
     Container container = containerSet.getContainer(containerId);
-
-    if (container.getContainerState() == State.OPEN) {
-      getHandler(container).markContainerForClose(container);
+    if (container==null) {
+      Set<Long> missingContainerSet = containerSet.getMissingContainerSet();
+      if (missingContainerSet.contains(containerId)) {
+        LOG.warn("The Container is in the MissingContainerSet " +
+                "hence we can't close it. ContainerID: {}", containerId);
+      } else {
+        LOG.warn("The Container is not found. ContainerID: {}", containerId);
+      }
+    } else {
+      if (container.getContainerState() == State.OPEN) {
+        getHandler(container).markContainerForClose(container);
+      }

Review comment:
       Thank you for your input. I have place Log here so that we could have a 
better understanding of whether the container is present in the 
MissingContainerSet or not which allows us to debug better. @avijayanhwx your 
thoughts on that? 




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