devmadhuu commented on code in PR #11917:
URL: https://github.com/apache/ozone/pull/11917#discussion_r4578177686
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/SCMCommonPlacementPolicy.java:
##########
@@ -418,6 +436,24 @@ public List<DatanodeDetails> getResultSet(
public abstract DatanodeDetails chooseNode(
List<DatanodeDetails> healthyNodes);
+ /**
+ * Choose a datanode according to the policy, ranking candidates by their
usage
+ * of the given storage type.
Review Comment:
Yeah, this should be rephrased.
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRandom.java:
##########
@@ -91,7 +91,9 @@ protected List<DatanodeDetails> chooseDatanodesInternal(
if (healthyNodes.size() == nodesRequired) {
return healthyNodes;
}
- return getResultSet(nodesRequired, healthyNodes);
+ // Selection is random, so storageType does not affect ranking here; the
+ // healthy node list is already filtered to it.
+ return getResultSet(nodesRequired, healthyNodes, storageType);
Review Comment:
Thanks, you’re right. These calls were carried over from the original patch
to forward the requested type consistently, but they do not change the current
random-selection behavior. Storage-type eligibility is already checked before
getResultSet(), and these policies ignore the type during selection.
--
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]