Skip to content

Commit

Permalink
Add comment with link to gRFC
Browse files Browse the repository at this point in the history
  • Loading branch information
s-matyukevich committed Jul 31, 2023
1 parent ac526ee commit 74ba7e0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions balancer/deterministicsubsetting/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func (b *subsettingBalancer) UpdateClientConnState(s balancer.ClientConnState) e
return err
}

// implements the subsetting algorithm, as described in A68: https://github.com/grpc/proposal/pull/383
func (b *subsettingBalancer) prepareChildResolverState(s resolver.State) resolver.State {
if len(s.Addresses) <= int(b.cfg.SubsetSize) {
return s
Expand All @@ -76,8 +77,6 @@ func (b *subsettingBalancer) prepareChildResolverState(s resolver.State) resolve
copy(addresses, s.Addresses)

if b.cfg.SortAddresses {
// sort address list by IP because the algorithm assumes that the initial
// order of the addresses is the same for every client
sort.Slice(addresses, func(i, j int) bool {
return addresses[i].Addr < addresses[j].Addr
})
Expand Down

0 comments on commit 74ba7e0

Please sign in to comment.