szetszwo commented on code in PR #10000:
URL: https://github.com/apache/ozone/pull/10000#discussion_r3162988799


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerManagerImpl.java:
##########
@@ -269,6 +269,7 @@ private ContainerInfo allocateContainer(final Pipeline 
pipeline,
     }
 
     containerStateManager.addContainer(containerInfoBuilder.build());
+    pipelineManager.recordPendingAllocation(pipeline, containerID);

Review Comment:
   hasEnoughSpace and recordPendingAllocation should be atomic.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerReportHandler.java:
##########
@@ -175,6 +177,13 @@ public void onMessage(final ContainerReportFromDatanode 
reportFromDatanode,
           if (!alreadyInDn) {
             // This is a new Container not in the nodeManager -> dn map yet
             getNodeManager().addContainer(datanodeDetails, cid);
+            // Remove from pending tracker when container is added to DN
+            // This container was just confirmed for the first time on this DN
+            PendingContainerTracker tracker = 
getNodeManager().getPendingContainerTracker();
+            DatanodeInfo datanodeInfo = 
getNodeManager().getDatanodeInfo(datanodeDetails);

Review Comment:
   We should get tracker and datanodeInfo outside the loop.
   
   BTW, the datanodeDetails object actually is already a DatanodeInfo since 
SCMNodeManager.getNode(..) returns DatanodeInfo; filed HDDS-15146.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/IncrementalContainerReportHandler.java:
##########
@@ -103,6 +105,11 @@ protected void 
processICR(IncrementalContainerReportFromDatanode report,
           }
           if (ContainerReportValidator.validate(container, dd, replicaProto)) {
             processContainerReplica(dd, container, replicaProto, publisher, 
detailsForLogging);
+            PendingContainerTracker tracker = 
getNodeManager().getPendingContainerTracker();
+            DatanodeInfo datanodeInfo = getNodeManager().getDatanodeInfo(dd);

Review Comment:
   Similarly, we should get tracker and datanodeInfo outside the loop.



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