diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelinePlacementPolicy.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelinePlacementPolicy.java index 80374299b637..c4bfd3d1cd0e 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelinePlacementPolicy.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelinePlacementPolicy.java @@ -146,15 +146,17 @@ List filterViableNodes( healthyNodes = filterNodesWithSpace(healthyNodes, nodesRequired, metadataSizeRequired, dataSizeRequired); boolean multipleRacks = multipleRacksAvailable(healthyNodes); + int excludedNodesSize = 0; if (excludedNodes != null) { + excludedNodesSize = excludedNodes.size(); healthyNodes.removeAll(excludedNodes); } int initialHealthyNodesCount = healthyNodes.size(); if (initialHealthyNodesCount < nodesRequired) { msg = String.format("Pipeline creation failed due to no sufficient" + - " healthy datanodes. Required %d. Found %d.", - nodesRequired, initialHealthyNodesCount); + " healthy datanodes. Required %d. Found %d. Excluded %d.", + nodesRequired, initialHealthyNodesCount, excludedNodesSize); LOG.warn(msg); throw new SCMException(msg, SCMException.ResultCodes.FAILED_TO_FIND_SUITABLE_NODE); @@ -178,14 +180,16 @@ List filterViableNodes( if (LOG.isDebugEnabled()) { LOG.debug("Unable to find enough nodes that meet the criteria that" + " cannot engage in more than" + heavyNodeCriteria + - " pipelines. Nodes required: " + nodesRequired + " Found:" + + " pipelines. Nodes required: " + nodesRequired + " Excluded: " + + excludedNodesSize + " Found:" + healthyList.size() + " healthy nodes count in NodeManager: " + initialHealthyNodesCount); } msg = String.format("Pipeline creation failed because nodes are engaged" + " in other pipelines and every node can only be engaged in" + - " max %d pipelines. Required %d. Found %d", - heavyNodeCriteria, nodesRequired, healthyList.size()); + " max %d pipelines. Required %d. Found %d. Excluded: %d.", + heavyNodeCriteria, nodesRequired, healthyList.size(), + excludedNodesSize); throw new SCMException(msg, SCMException.ResultCodes.FAILED_TO_FIND_SUITABLE_NODE); }