Github user mkscrg commented on the issue:
https://github.com/apache/helix/pull/59
I think this strategy accounts for partition count and priority:
- it assigns each state a "score", which is just a reverse numbering of the
priority-ordered state list
- it ranks nodes according to the sum of the state scores of the partitions
on the node
I modified my test code to your 2/6 scenario, and it worked as expected:
```
Setting up cluster THE_CLUSTER
Starting CONTROLLER
Starting NODE_0
Starting NODE_1
Adding resource R
Rebalancing resource R
Transition: NODE_0 OFFLINE to ONLINE for R_0
Transition: NODE_1 OFFLINE to ONLINE for R_3
Transition: NODE_1 OFFLINE to ONLINE for R_5
Transition: NODE_1 OFFLINE to ONLINE for R_1
Transition: NODE_0 OFFLINE to ONLINE for R_4
Transition: NODE_0 OFFLINE to ONLINE for R_2
Cluster state after setup:
NODE_0 NODE_1
R_0 ONLINE null
R_1 null ONLINE
R_2 ONLINE null
R_3 null ONLINE
R_4 ONLINE null
R_5 null ONLINE
------------------------------------------------------------
Starting NODE_2
Transition: NODE_0 ONLINE to OFFLINE for R_2
Transition: NODE_1 ONLINE to OFFLINE for R_5
Transition: NODE_0 OFFLINE to DROPPED for R_2
Transition: NODE_1 OFFLINE to DROPPED for R_5
Transition: NODE_2 OFFLINE to ONLINE for R_5
Transition: NODE_2 OFFLINE to ONLINE for R_2
Cluster state after starting third node:
NODE_0 NODE_1 NODE_2
R_0 ONLINE null null
R_1 null ONLINE null
R_2 null null ONLINE
R_3 null ONLINE null
R_4 ONLINE null null
R_5 null null ONLINE
------------------------------------------------------------
```
I can gist the test code if helpful.
You mentioned
> We already have that test case.
How do you run the test cases? I've noticed the `build` script has them
disabled, and a simple `mvn clean install` fails.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---