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



##########
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:
       This is an usually case that container is not found.  I would suggest 
throw an container not found storage exception here,  the outer has the logic 
to handle the exception.  
   




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