We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supposing we have 10 upstreams with equal weight = 1.
The current algo selects a random value from the range [0, upperBound] where upperBound in inclusive calculates prefixSums for each upstream:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Later the algo finds the first index at prefixSums where
prefixSum[index] >= randomValue
where index is an index of the upstream to be selected
index
The problem is that all upstreams have equal ranges, the random value may be in except for the 1st upstream
[0,1],[2,2],[3,3],...,[10,10]
So the 1st upstream have in twice more possibility to be chosen than others.
The text was updated successfully, but these errors were encountered:
fix: RandomizedWeightedBalancer chooses the first upstream with highe…
f7a330b
…r probability than others #666
e33e307
…r probability than others #666 (#667)
astsiapanay
No branches or pull requests
Supposing we have 10 upstreams with equal weight = 1.
The current algo selects a random value from the range [0, upperBound] where upperBound in inclusive
calculates prefixSums for each upstream:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Later the algo finds the first index at prefixSums where
prefixSum[index] >= randomValue
where
index
is an index of the upstream to be selectedThe problem is that all upstreams have equal ranges, the random value may be in except for the 1st upstream
[0,1],[2,2],[3,3],...,[10,10]
So the 1st upstream have in twice more possibility to be chosen than others.
The text was updated successfully, but these errors were encountered: