grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

examples: Add custom load balancer example

Open zasweq opened this issue 1 year ago • 3 comments

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.

RELEASE NOTES:

  • examples: Add custom lb example

zasweq avatar Oct 05 '23 18:10 zasweq

Codecov Report

Merging #6691 (944499d) into master (adf976b) will decrease coverage by 0.47%. Report is 6 commits behind head on master. The diff coverage is 13.21%.

:exclamation: Current head 944499d differs from pull request most recent head 7af9e93. Consider uploading reports for the commit 7af9e93 to get more accurate results

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     
Files Coverage Δ
pickfirst.go 82.69% <88.46%> (+0.47%) :arrow_up:
balancer/balanceraggregator/balanceraggregator.go 0.00% <0.00%> (ø)

... and 24 files with indirect coverage changes

codecov[bot] avatar Oct 12 '23 21:10 codecov[bot]

Please rebase your comment before merging.

ginayeh avatar Oct 31 '23 16:10 ginayeh

Done.

zasweq avatar Oct 31 '23 17:10 zasweq

Added BalancerAggregator utility we discussed offline :). This is ready to review now.

zasweq avatar Mar 28 '24 22:03 zasweq

Added to examples test as discussed offline.

zasweq avatar Apr 12 '24 21:04 zasweq

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).

zasweq avatar Apr 17 '24 00:04 zasweq

And move pick first :).

zasweq avatar Apr 17 '24 17:04 zasweq