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: [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]