You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "junkaixue (via GitHub)" <gi...@apache.org> on 2024/02/22 18:09:33 UTC
Re: [PR] Ensure Top State Evenness When Capacity Keys Not Defined [helix]
junkaixue commented on code in PR #2760:
URL: https://github.com/apache/helix/pull/2760#discussion_r1499696410
##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/TopStateMaxCapacityUsageInstanceConstraint.java:
##########
@@ -39,6 +41,14 @@ protected double getAssignmentScore(AssignableNode node, AssignableReplica repli
// So return zero on any assignable node candidate.
return 0;
}
+
+ // No node or replica capacity defined, we default to just looking at # top state
+ if (node.getMaxCapacity().isEmpty() && replica.getCapacity().isEmpty()) {
+ int curTopPartitionCountForResource = node.getAssignedTopStatePartitionsCount();
+ int estimatedMaxTopStateCount = clusterContext.getEstimatedMaxTopStateCount();
+ return computeUtilizationScore(estimatedMaxTopStateCount, curTopPartitionCountForResource);
+ }
Review Comment:
Will this be the right behavior? If Capacity is not defined, we should not process and let the computation failed because this is an error.
Adding this code is more like a hiding the problem.
Expected behavior should be :
1. Evenness of top state should be handled in different constraint.
2. If it miss the required field, we should fail the computation and let user handle it.
--
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: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org