-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
examples: Add custom load balancer example #6691
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6691 +/- ##
==========================================
- Coverage 81.24% 80.77% -0.47%
==========================================
Files 345 346 +1
Lines 33941 34094 +153
==========================================
- Hits 27574 27541 -33
- Misses 5202 5379 +177
- Partials 1165 1174 +9
|
fbd54b9
to
9521bb6
Compare
Please rebase your comment before merging. |
Done. |
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 have a lot of comments. Maybe we should just simplify this for now and make something small that doesn't need to worry about being a petiole policy just so we can get it done with a reasonable amount of effort.
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
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.
Got to all comments. Thanks for the pass.
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
7aafeef
to
0994c23
Compare
Added BalancerAggregator utility we discussed offline :). This is ready to review now. |
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
8780a34
to
3e18a93
Compare
7e0b07d
to
aead17f
Compare
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
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.
Can you please add a simple test or 2 into the endpointsharding (or whatever we call it) package, please?
examples/features/customloadbalancer/client/customroundrobin/customroundrobin.go
Outdated
Show resolved
Hide resolved
Added e2e test that tested the main behaviors I view endpoint sharding to have (a child per endpoint, default behavior of round robin over pickers in aggregated state, access to child picker in parent UpdateState). |
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.
🎉
Now to rewrite round_robin 😆
And move pick first :). |
Contains #6679. This PR adds a custom load balancer example, deployed as the top level balancer of the channel through a service config. This custom load balancer is a petiole policy wrapping pick first, which is the intended way we want users to write their own custom load balancers, as users get features such as Sticky Transient Failure, Health Checking, and the Happy Eyeballs algorithm out of the box.
As part of this PR, pick_first is changed to work on the endpoints list and handle the endpoints list as defined in A61. This change works within system because the Channel is already emitting a Slice of Endpoints.
A helper interface between the petiole policy and the base pick first is also added. This lets petiole policy focus on the business logic, as seen by the simplicitly of custom_round_robin.
RELEASE NOTES: