You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/06/29 15:32:29 UTC

[GitHub] [ozone] sodonnel commented on a change in pull request #2377: HDDS-5296. Replication Manager should not sent replica command to DN which is not in IN_SERVICE opState

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



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackAware.java
##########
@@ -275,28 +277,32 @@ 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 {}",
+
+      DatanodeInfo datanodeInfo = (DatanodeInfo) node;
+      NodeStatus nodeStatus = datanodeInfo.getNodeStatus();
+      if (nodeStatus.isNodeWritable() &&
+          (super.hasEnoughSpace(datanodeInfo, sizeRequired))) {
+        LOG.debug("Datanode {} is chosen. Required storage size is {} bytes",
             node.toString(), sizeRequired);

Review comment:
       `node.toString()` is going to always be executed even with INFO level logs. This should be changed to just `node` and let the logger call toString on it internally if debug is enabled.




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org