smengcl commented on a change in pull request #2321:
URL: https://github.com/apache/ozone/pull/2321#discussion_r652122145



##########
File path: 
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconContainerManager.java
##########
@@ -203,6 +207,13 @@ private void checkContainerStateAndUpdate(ContainerID 
containerID,
         && isHealthy(state)) {
       LOG.info("Container {} has state OPEN, but given state is {}.",
           containerID, state);
+      Pipeline pipeline =
+              pipelineManager.getPipeline(containerInfo.getPipelineID());
+      // subtract open container count from the pipeline
+      int curCnt = pipelineToOpenContainer.getOrDefault(pipeline.getId(), 0);
+      if (curCnt > 0) {
+        pipelineToOpenContainer.put(pipeline.getId(), curCnt - 1);
+      }

Review comment:
       ```suggestion
         int curCnt = pipelineToOpenContainer.getOrDefault(pipeline.getId(), 0);
         if (curCnt == 1) {
           pipelineToOpenContainer.remove(pipeline.getId());
         } else if (curCnt > 0) {
           pipelineToOpenContainer.put(pipeline.getId(), curCnt - 1);
         }
   ```




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

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