grpc-js: Make pick_first the universal leaf policy, plus related changes #2561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This includes most of the changes in the in-progress gRFC A61: IPv4 and IPv6 Dualstack Backend Support. In particular, this has the following changes:
updateAddressList
method of aLoadBalancer
now takes anEndpoint
list instead of aSubchannelAddress
list. AnEndpoint
contains a list ofSubchannelAddresses
.Endpoint
list instead of aSubchannelAddress
list.SubchannelInterface
now includes additional methods for reporting health state separately from connectivity state, for pick_first to use as a leaf policy. The outlier_detection LB policy now uses this API to report ejections.All load balancers and resolvers needed to be updated with the new API. The only substantive change in the xDS library was in the
xds_cluster_impl
LB policy: the locality is now attached to the endpoint instead of the individual subchannel address, so the procedure to determine the locality for an address when wrapping it for load reporting is different.Currently nothing that produces endpoint lists produces any endpoints with more than one address, so the end-to-end functionality that handles that case is not yet tested. In the future, support will be added for multiple addresses per endpoint in EDS, and that behavior will be tested then.
Experimental API changes:
Endpoint
,endpointToString
,endpointHasAddress
,LeafLoadBalancer
, andHealthListener
.LoadBalancer#updateAddressList
now takesEndpoint[]
instead ofSubchannelAddress[]
as the first argument.ResolverListener#onSuccessfulResolution
now takesEndpoint[]
instead ofSubchannelAddress[]
as the first argument.SubchannelInterface
has the new methodsisHealthy
,addHealthStateWatcher
, andremoveHealthStateWatcher
.SubchannelWrapper
has the new protected methodsetHealthy
and has default implementations of the other new methods, to easily manage health status.