Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make shard balancing deterministic if weights are identical
It happens to be the case that the iteration order of a HashMaps keyset might be different across runs. This can cause undeterministic results in shard balancing if weights are identical and multiple shards of the same index are eligable for relocation. This commit adds a tie-breaker based on the shard ID to prioritise the lowest shard ID. This also makes `AddIncrementallyTests#testAddNodesAndIndices` reproducible. Closes #4867
- Loading branch information