Closed himanshukandwal closed 5 months ago
Successful CI Build: https://github.com/himanshukandwal/helix/actions/runs/8286133854
You should update the description or add comments:
- We first sort on Preference List (does it have any special comparator?)
- We sort on StateModelDef
it would be useful to add comments.
Yes, updated the code with comments. Thanks Komal!
This change has been reviewed and approved by @zpinto and @desaikomal
Final Commit Message: Fixed PreferenceList Ordering Changes (indeterminism) during Maintenance Mode.
Issues
Description
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 ]
Tests
Added Tests:
TestMaintenanceRebalancer.testComputeIdealState
This covers various scenarios where the preference list should be preserved wrt current stateChanges that Break Backward Compatibility (Optional)
(Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)
Documentation (Optional)
(Link the GitHub wiki you added)
Commits
Code Quality