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: [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]

Reply via email to