sodonnel commented on a change in pull request #2377:
URL: https://github.com/apache/ozone/pull/2377#discussion_r669449926



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackAware.java
##########
@@ -275,28 +276,38 @@ private Node chooseNode(List<Node> excludedNodes, Node 
affinityNode,
         throw new SCMException("No satisfied datanode to meet the" +
             " excludedNodes and affinityNode constrains.", null);
       }
-      if (super.hasEnoughSpace((DatanodeDetails)node, sizeRequired)) {
-        LOG.debug("Datanode {} is chosen. Required size is {}",
-            node.toString(), sizeRequired);
-        metrics.incrDatanodeChooseSuccessCount();
-        if (isFallbacked) {
-          metrics.incrDatanodeChooseFallbackCount();
-        }
-        return node;
+
+      DatanodeDetails datanodeDetails = (DatanodeDetails)node;
+      DatanodeInfo datanodeInfo = (DatanodeInfo)getNodeManager()
+          .getNodeByUuid(datanodeDetails.getUuidString());
+      if (datanodeInfo == null) {
+        LOG.error("Failed to find the DatanodeInfo for datanode {}",
+            datanodeDetails);

Review comment:
       Ah, I missed the call to `hasEnoughSpace`. OK - I think this is good now.




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