Skip to content

api, xds: Move weighted_target's locality attribute to NameResolver - #13217

Open
shivaspeaks wants to merge 1 commit into
grpc:masterfrom
shivaspeaks:api-attr-locality
Open

shivaspeaks wants to merge 1 commit into
grpc:masterfrom
shivaspeaks:api-attr-locality

Conversation

@shivaspeaks

@shivaspeaks shivaspeaks commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

The autosharding LB policy (gRFC A119, #13039) needs it: it replaces %s in autosharding_target with the "Locality" attribute set by weighted_target and since autosharding cannot depend on xds we need to move it.

Placing the Attribute ATTR_LOCALITY in NameResolver.java because looking at the history ATTR_BACKEND_SERVICE was also moved to NameResolver (#11990).

@shivaspeaks
shivaspeaks requested a review from sauravzg December 3, 2026 06:13

@sauravzg sauravzg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is worth a discussion.
I am not convinced about adding an internal attribute to a public class which doesn't have any other internal attributes.

Our attributes are sprayed across the board in LoadBalancer, NameResolver, EAG and GrpcAttributes.

At a first look, I tend to lean towards internal version of GrpcAttributes since that doesn't leak at all into any public class at all.

@kannanjgithub Do you know the correct place to add this attribute which is supposed to be populated by the weighted target lb policy?

This branch has not been deployed

No deployments
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.

2 participants