narendly commented on a change in pull request #535: Adjust the replica
rebalance calculating ordering method to avoid a static order.
URL: https://github.com/apache/helix/pull/535#discussion_r339750444
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/ConstraintBasedAlgorithm.java
##########
@@ -162,12 +162,19 @@ private double
getAssignmentNormalizedScore(AssignableNode node, AssignableRepli
int statePriority1 = replica1.getStatePriority();
int statePriority2 = replica2.getStatePriority();
if (statePriority1 == statePriority2) {
- // If state prioritizes are the same, compare the names.
- if (resourceName1.equals(resourceName2)) {
- return
replica1.getPartitionName().compareTo(replica2.getPartitionName());
- } else {
- return resourceName1.compareTo(resourceName2);
- }
+ // If state prioritizes are the same, try to randomize the
replicas order. Otherwise,
+ // the same replicas might always be moved in the rebalance. This
is because their
+ // rebalance calculating will always happen at the critical moment
while the cluster is
+ // almost full.
Review comment:
What's confusing me is that usually we want a static order in rebalance so
we know what to expect, and that way it's easier for us to debug, track, and
test. That has been the case with CrushED rebalancer where we sort all
resources and partitions by lexical order.
So the fact that you're avoiding the static order in which replicas are
given to the rebalancer sounds counter-intuitive to me. So I'd like to
understand why it's different in the WAGED rebalancer setting. Also, the
description claims that the static ordering makes the rebalance unstable. How
so?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]