Skip to content

Conversation

@ejona86
Copy link
Member

@ejona86 ejona86 commented May 8, 2024

As part of gRFC A78:

To support the locality label in the WRR metrics, we will extend the
weighted_target LB policy (see A28) to define a resolver attribute
that indicates the name of its child. This attribute will be passed
down to each of its children with the appropriate value, so that any
LB policy that sits underneath the weighted_target policy will be
able to use it.

xds_cluster_impl is involved because it uses the child names in the AddressFilter, which must match the names used by weighted_target. Instead of using Locality.toString() in multiple policies and assuming the policies agree, we now have xds_cluster_impl decide the locality's name and pass it down explicitly. This allows us to change the name format to match gRFC A78:

If locality information is available, the value of this label will be
of the form {region="${REGION}", zone="${ZONE}", sub_zone="${SUB_ZONE}"}, where ${REGION}, ${ZONE}, and
${SUB_ZONE} are replaced with the actual values. If no locality
information is available, the label will be set to the empty string.


CC @DNVindhya, @temawi. The API exposed to WRR will be WeightedTargetLoadBalancer.CHILD_NAME

Backport of #11133

As part of gRFC A78:

> To support the locality label in the WRR metrics, we will extend the
> `weighted_target` LB policy (see A28) to define a resolver attribute
> that indicates the name of its child. This attribute will be passed
> down to each of its children with the appropriate value, so that any
> LB policy that sits underneath the `weighted_target` policy will be
> able to use it.

xds_cluster_impl is involved because it uses the child names in the
AddressFilter, which must match the names used by weighted_target.
Instead of using Locality.toString() in multiple policies and assuming
the policies agree, we now have xds_cluster_impl decide the locality's
name and pass it down explicitly. This allows us to change the name
format to match gRFC A78:

> If locality information is available, the value of this label will be
> of the form `{region="${REGION}", zone="${ZONE}",
> sub_zone="${SUB_ZONE}"}`, where `${REGION}`, `${ZONE}`, and
> `${SUB_ZONE}` are replaced with the actual values. If no locality
> information is available, the label will be set to the empty string.
@ejona86 ejona86 requested a review from temawi May 8, 2024 22:14
@ejona86 ejona86 merged commit 8f81bd2 into grpc:v1.64.x May 8, 2024
@ejona86 ejona86 deleted the backport-xds-locality-weight-target-1.64 branch May 8, 2024 22:50
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2024
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.

2 participants