-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
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
maglev: fix maglev stability by sorting host_weights beforehand #28055
Conversation
Signed-off-by: Yuichiro Ueno <ueno@preferred.jp>
Hi @y1r, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides small nit this looks great! Thanks for working on this.
/wait |
Signed-off-by: Yuichiro Ueno <ueno@preferred.jp>
Signed-off-by: Yuichiro Ueno <ueno@preferred.jp>
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ok without a runtime guard as this would be a very small behavioral change. cc @envoyproxy/runtime-guard-changes
Will merge fix if no objections.
need merge main and resolve the conflict. Thanks. /wait |
Signed-off-by: Yuichiro Ueno <ueno@preferred.jp>
fc51779
to
ef45f35
Compare
…yproxy#28055) * maglev: fix maglev stability by sorting host_weights beforehand Signed-off-by: Yuichiro Ueno <ueno@preferred.jp> Signed-off-by: asheryer <asheryer@amazon.com>
…yproxy#28055) * maglev: fix maglev stability by sorting host_weights beforehand Signed-off-by: Yuichiro Ueno <ueno@preferred.jp> Signed-off-by: Ryan Eskin <ryan.eskin89@protonmail.com>
Commit Message:
This PR fixes MaglevLoadBalancer's stability problem reported in #20703. Maglev algorithm prepares hash table by visiting permutations (assignment preference list of each backend) one-by-one, then fill hash table by choosing key from the top of the list. The order of permutation visiting should be stable because this order sightly affects the hash table. In order to make stable the order, I sorted
host_weights
bykey_to_hash
value then constructs the hash table.In order to check the problem is solved or not, I appended BasicStability test to
maglev_lb_test.cc
. Without changes tomaglev_lb.cc
, this test will fail.Additional Description:
Risk Level: Low
Testing: Unit Test
Docs Changes:
Release Notes: loadbalancer: maglev now returns stable key assignment by sorting the backend beforehand
Platform Specific Features:
Fixes #20703