Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,17 @@ List<DatanodeDetails> 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);
Expand All @@ -178,14 +180,16 @@ List<DatanodeDetails> 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);
}
Expand Down