[grpc/core][xds] What's the reason to time locality lb weight and endpoint lb weight in CreateChildPolicyAddressesLocked ?

33 views
Skip to first unread message

echo...@gmail.com

unread,
Aug 25, 2022, 3:03:50 PM8/25/22
to grpc.io
What's the reason to time locality lb weight and endpoint lb weight in CreateChildPolicyAddressesLocked?

iiuc, it performs 2 layer LB. It first does a  weighted target using locality lb weight. Then a child policy which can use endpoint lb weight. So why do we need to time the 2 weight?

https://sourcegraph.com/github.com/grpc/grpc/-/blob/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc?L810:22

Thanks,
yishu

Mark D. Roth

unread,
Sep 7, 2022, 2:33:07 PM9/7/22
to echo...@gmail.com, grpc.io
In the case of the xDS ROUND_ROBIN policy, where we first use weighted_target to pick the locality and then use round_robin to pick the endpoint within that locality, this multiplication isn't needed (although it doesn't hurt either, since the resulting weights are still proportional to the intended values).  However, the multiplication is needed for the xDS RING_HASH case, where we have a single policy that does both locality- and endpoint-picking in a single step.  For details, see the gRFC for ring_hash support:


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/367fb6d9-c90d-4dd9-a148-ff59f76dd452n%40googlegroups.com.


--
Mark D. Roth <ro...@google.com>
Software Engineer
Google, Inc.
Reply all
Reply to author
Forward
0 new messages