-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
balancer: start populating weight by edsbalancer for weighted_round_robin #2945
Changes from 2 commits
cb87777
9edeb3e
a1151e7
d9e8f02
e7bf8d1
b213c31
5dd2711
f82ee2e
c4e8d90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package wrr | ||
alazarev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Name is the name of weighted_round_robin balancer. | ||
const Name = "weighted_round_robin" | ||
|
||
// Information that should be stored inside Address metadata in order to use wrr. | ||
type Info struct{ | ||
alazarev marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe let's make it an interface, e.g.
? This would allow us to provide some object with xds-specific knowledge (e.g. is it a canary instance?) in the future, which would also implement the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also it may make sense to move this interface to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with interface is, it's hard to add methods. But for structs, we can add fields. I also think it's better to not keep it in |
||
Weight uint32 | ||
} |
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.
With changes in this file, we will still unnecessarily reconnect when the weight for an address changes.
To avoid that, we should clear metadata field when addresses are received.
But this changes the behavior.
Base is to be used as an example, and in the case only picking algorithm is different.
I think we should leave
base
package as is, and re-implement this for wrr.wrr will have some special behaviors, some I can think of now:
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.
In this care diff becomes really small, just weightedroundrobin package declaration with metadata population in edsbalancer. Updated pull request.