GrantPSpencer commented on code in PR #2760:
URL: https://github.com/apache/helix/pull/2760#discussion_r1523878110
##########
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:
Currently users can onboard to WAGED without setting instance and partition
capacities. WAGED validation fails if only 1 has been defined or if there are
missing keys, but will successfully run if neither are defined. In this case,
WAGED doesn't ensure any top state evenness as the assignment scores will
always be 0 and tiebreak will be determined by the node's logicalID.
Should the expectation that users have to define at least a default instance
and partition capacity for the cluster? Like so:
```
"mapFields": {
"DEFAULT_INSTANCE_CAPACITY_MAP": {
"PARTCOUNT": "2000",
},
"DEFAULT_PARTITION_WEIGHT_MAP": {
"PARTCOUNT": "386"
}
...
"listFields": {
"INSTANCE_CAPACITY_KEYS": [
"PARTCOUNT"
]
```
--
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]