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: Plumb locality in xds_cluster_impl and weighted_target (1.64.x backport) #11179

Merged

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
13 checks passed
@ejona86 ejona86 deleted the backport-xds-locality-weight-target-1.64 branch May 8, 2024 22:50
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