adoroszlai commented on code in PR #11981:
URL: https://github.com/apache/ozone/pull/11981#discussion_r4577558748
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackAware.java:
##########
@@ -120,11 +122,11 @@ protected List<DatanodeDetails> chooseDatanodesInternal(
int datanodeCount = networkTopology.getNumOfLeafNode(NetConstants.ROOT);
int excludedNodesCount = excludedNodes == null ? 0 : excludedNodes.size();
int usedNodesCount = usedNodes == null ? 0 : usedNodes.size();
- if (datanodeCount < nodesRequired + excludedNodesCount + usedNodesCount) {
- throw new SCMException("No enough datanodes to choose. " +
- "TotalNode = " + datanodeCount + " RequiredNode = " + nodesRequired +
- " ExcludedNode = " + excludedNodesCount +
- " UsedNode = " + usedNodesCount, null);
+ int unavailableNodesCount = countUnavailableNodes(usedNodes,
excludedNodes);
+ if (datanodeCount < nodesRequired + unavailableNodesCount) {
+ throw new SCMException("Not enough datanodes to choose. TotalNode = " +
datanodeCount +
Review Comment:
Sorry, I just found that there are
- few other places with the same typo
- some tests that check the message with this typo (apparently not this code
path)
```suggestion
throw new SCMException("No enough datanodes to choose. TotalNode = " +
datanodeCount +
```
So it's better to fix them all separately.
--
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]