ClusterImplLoadBalancer assumes all addresses for a subchannel are in the same locality:
|
Locality locality = args.getAddresses().get(0).getAttributes().get( |
|
InternalXdsAttributes.ATTR_LOCALITY); // all addresses should be in the same locality |
That is the case when pick_first is being used as an endpoint-picking policy. But when pick_first is being used for affinity cross-locality (instead of ring_hash), that is wrong and can assign the load to the wrong locality.
The PickFirstLeafLoadBalancer doesn't have this problem, because it uses a separate subchannel for each address. But it also is not the default (again).
b/349186137