Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce rand dist weight range for
distanceAndLoad
& adaptive
sort
Previously, an unknown client/server IP resulted in a random distance weight in (-1, 0]. However, in `distanceAndLoad`/`adaptive` sort, this means a bad choice of random distance weight could overpower information we potentially _do_ know from the load/availability statistics. By pinning the random dist weight to a small range of (-0.475, -0.525], we preserve the stochastic element of the sorting algorithm (in case load/availability stats aren't populated), while making sure that any other known statistics over power the distance weight for calculating server priority. I have no solid empirical evidence this is the _right_ range, but running the sort tests through a loop 10,000 times showed stability, whereas before the change, I could observe a failure from the random weights every 4-5 runs.
- Loading branch information