himanshukandwal opened a new issue, #2777:
URL: https://github.com/apache/helix/issues/2777
### Describe the bug
When entering maintenance-mode, we observed that instance order in
preference list changes by PreferenceListNodeComparator as it uses the order in
which the current-state is materialized in array list.
For instance:
Lets say we have 3 hosts, and here's the Current state:
```
{
A: LEADER,
B: FOLLOWER
C: FOLLOWER
}
```
Now when we create a preference-list using new
ArrayList(currentState.keySet), the order in array-list depends on the hash
order the keys (A, B, C). With sorting using PreferenceListNodeComparator, we
put Leader at the front and ordering among Followers can be anything and could
either be [A, B, C] or [A, C, B ]
### To Reproduce
If we have a set of string where the hash order is different than the insert
order then we can see this issue:
Insert order: [Q3ZZuCeBpu, QY9U91XBYo, GMYBW20gmC]
Hash set order: [GMYBW20gmC, QY9U91XBYo, Q3ZZuCeBpu]
### Expected behavior
The preference list order should not change as computed earlier.
### Additional context
Add any other context about the problem here.
--
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]