Skip to content
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

grpc-js: Make pick_first the universal leaf policy, plus related changes #2561

Merged
merged 4 commits into from Aug 31, 2023

Conversation

murgatroid99
Copy link
Member

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:

  • The updateAddressList method of a LoadBalancer now takes an Endpoint list instead of a SubchannelAddress list. An Endpoint contains a list of SubchannelAddresses.
  • Resolver results are an Endpoint list instead of a SubchannelAddress list.
  • The round_robin LB policy now delegates to pick_first for each endpoint, instead of managing subchannels directly.
  • The outlier_detection LB policy now tracks call results and ejections by endpoint instead of by address.
  • The 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:

  • Added Endpoint, endpointToString, endpointHasAddress, LeafLoadBalancer, and HealthListener.
  • LoadBalancer#updateAddressList now takes Endpoint[] instead of SubchannelAddress[] as the first argument.
  • ResolverListener#onSuccessfulResolution now takes Endpoint[] instead of SubchannelAddress[] as the first argument.
  • SubchannelInterface has the new methods isHealthy, addHealthStateWatcher, and removeHealthStateWatcher.
  • SubchannelWrapper has the new protected method setHealthy and has default implementations of the other new methods, to easily manage health status.

@murgatroid99 murgatroid99 merged commit 092d1e9 into grpc:master Aug 31, 2023
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants