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

xds: support ring_hash as the endpoint-level LB policy #7991

Conversation

voidzcy
Copy link
Contributor

@voidzcy voidzcy commented Mar 18, 2021

To be merged after #7943.

There two main parts of this change:

  • Changed the CDS LB policy to accept "ring_hash" as the endpoint LB policy from CDS updates. This configuration is directly passed to its child policy (aka, ClusterResolverLoadBalancer) in its config.
    • Note, for underlying clusters of an aggregate cluster, its endpoint-level LB policy is configured by the top-level cluster configuration.
  • Changed ClusterResolverLoadBalancer to generate different LB configs for its downstream LB policies. Depending on the endpoint-level LB policies, the downstream LB tree hierarchy will be different.
    • If the endpoint-level LB policy is "round_robin", the downstream LB policy hierarchy is: PriorityLB -> ClusterImplLB -> WeightedTargetLB -> RoundRobinLB (same as existing).
    • If the endpoin-level LB policy is "ring_hash", the downstream LB policy hierarchy is: PriorityLB -> ClusterImplLB -> RingHashLB. That is, endpoints in different localities are mixed together for load balancing. Each endpoints will be attached with a weight value that is the product of its endpoint-level weight and the weight of the locality it belongs to.

@voidzcy voidzcy added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Apr 9, 2021
@grpc-kokoro grpc-kokoro removed kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary labels Apr 9, 2021
@voidzcy voidzcy requested a review from dapengzhang0 April 9, 2021 17:39
@voidzcy
Copy link
Contributor Author

voidzcy commented Apr 12, 2021

This can be reviewed and merged now.

@dapengzhang0 dapengzhang0 self-assigned this Apr 12, 2021
Copy link
Member

@dapengzhang0 dapengzhang0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

xds/src/main/java/io/grpc/xds/CdsLoadBalancer2.java Outdated Show resolved Hide resolved
@voidzcy voidzcy merged commit b4fe07d into grpc:master Apr 16, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants