Skip to content

xds: refactor xdsresource.Endpoint to add resolver.Endpoint (gRFC A81)#8750

Merged
Pranjali-2501 merged 5 commits into
grpc:masterfrom
Pranjali-2501:endpoint
Dec 16, 2025
Merged

xds: refactor xdsresource.Endpoint to add resolver.Endpoint (gRFC A81)#8750
Pranjali-2501 merged 5 commits into
grpc:masterfrom
Pranjali-2501:endpoint

Conversation

@Pranjali-2501

@Pranjali-2501 Pranjali-2501 commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

This PR updates the internal xdsresource.Endpoint struct to contain a resolver.Endpoint instead of a []string to store the list of addresses associated with the endpoint gRFC A81. This change standardizes how backend information is stored and ensures that attributes (such as Hostname) are correctly associated with the endpoint hierarchy.

Key Changes:

Struct Update:

  • xdsresource.Endpoint now includes a ResolverEndpoint field (of type resolver.Endpoint) to store addresses and attributes. Remove the existing Address field (of type []string) and store address as a resolver.Endpoint field.

Attribute Handling:

  • Added SetHostname and GetHostname helpers to manage hostname metadata within resolver.Endpoint.Attributes.

Parsing Logic:

  • Updated parseEndpoints in unmarshal_eds.go to correctly populate the resolver.Endpoint object.

RELEASE NOTES: N/A

@Pranjali-2501 Pranjali-2501 added this to the 1.78 Release milestone Dec 6, 2025
@Pranjali-2501 Pranjali-2501 added Type: Feature New features or improvements in behavior Area: xDS Includes everything xDS related, including LB policies used with xDS. labels Dec 6, 2025
@codecov

codecov Bot commented Dec 6, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.45%. Comparing base (4c27cc8) to head (55e3899).
⚠️ Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
...nternal/xds/xdsclient/xdsresource/unmarshal_eds.go 82.35% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8750      +/-   ##
==========================================
+ Coverage   83.28%   83.45%   +0.16%     
==========================================
  Files         418      419       +1     
  Lines       32367    32566     +199     
==========================================
+ Hits        26958    27178     +220     
+ Misses       4034     4011      -23     
- Partials     1375     1377       +2     
Files with missing lines Coverage Δ
...rnal/xds/balancer/clusterresolver/configbuilder.go 94.07% <100.00%> (-0.05%) ⬇️
resolver/resolver.go 100.00% <ø> (ø)
...nternal/xds/xdsclient/xdsresource/unmarshal_eds.go 92.76% <82.35%> (-1.57%) ⬇️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pranjali-2501 Pranjali-2501 self-assigned this Dec 6, 2025
@Pranjali-2501 Pranjali-2501 requested a review from easwars December 7, 2025 15:25
@Pranjali-2501 Pranjali-2501 changed the title xds: refactor xdsresource.Endpoint to embed resolver.Endpoint xds: refactor xdsresource.Endpoint to embed resolver.Endpoint (gRFC A81) Dec 8, 2025
@Pranjali-2501 Pranjali-2501 requested a review from mbissa December 8, 2025 10:09
Comment thread internal/xds/xdsclient/tests/loadreport_test.go
Comment thread internal/xds/xdsclient/xdsresource/type_eds.go
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_eds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_eds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_eds.go
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_eds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_eds_test.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_eds_test.go Outdated
Comment thread internal/xds/balancer/clusterresolver/configbuilder_test.go Outdated
Comment thread internal/xds/balancer/clusterresolver/clusterresolver.go Outdated
easwars
easwars previously approved these changes Dec 10, 2025

@easwars easwars 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.

LGTM, modulo minor nits

Comment thread internal/xds/xdsclient/xdsresource/unmarshal_eds.go Outdated
Comment thread internal/xds/balancer/clusterresolver/configbuilder_test.go Outdated
@easwars easwars assigned Pranjali-2501 and unassigned easwars Dec 10, 2025
Comment thread internal/xds/balancer/clusterresolver/configbuilder.go Outdated
@easwars easwars dismissed their stale review December 10, 2025 19:54

We need more discussion on safely copying resolver.Endpoint and resolver.Address structs.

@Pranjali-2501 Pranjali-2501 changed the title xds: refactor xdsresource.Endpoint to embed resolver.Endpoint (gRFC A81) xds: refactor xdsresource.Endpoint to add resolver.Endpoint (gRFC A81) Dec 11, 2025
Comment thread internal/xds/balancer/clusterresolver/configbuilder.go Outdated
Comment thread internal/xds/balancer/clusterresolver/configbuilder.go Outdated
Comment thread internal/xds/balancer/clusterresolver/configbuilder.go Outdated
@easwars easwars assigned Pranjali-2501 and unassigned easwars Dec 16, 2025
@Pranjali-2501 Pranjali-2501 merged commit 6ed8acb into grpc:master Dec 16, 2025
14 checks passed
Pranjali-2501 added a commit that referenced this pull request Jan 5, 2026
…icy (gRFC A81) (#8779)

This PR implements the xDS :authority header rewriting feature as
specified in [gRFC
A81](https://github.com/grpc/proposal/blob/master/A81-xds-authority-rewriting.md)

### Key Changes:

* xds_cluster_impl LB Policy:
* Updated the Picker to check for the auto_host_rewrite flag (passed via
ConfigSelector).
* If enabled, the picker retrieves the hostname attribute from the
subchannel .
* The picker populates the Metadata field in PickResult with the new
:authority value.

* changes in  stream.go:
* Updated stream.go to inspect the PickResult metadata. If an :authority
override is present and the user has not explicitly set an authority via
CallOption, the `callHdr.Authority` is updated with hostname.
   
* PR relies on the following changes already merged:
* Bootstrap config change (#8692): Added the trusted_xds_server server
feature to the bootstrap configuration.
* xDS resource validation (#8728): Implemented validation and extraction
of the auto_host_rewrite field from RDS resources and the hostname field
from EDS resources.
* Endpoint Structure (#8750): Refactored xdsresource.Endpoint to use
resolver.Endpoint, ensuring that attributes (like the endpoint's
hostname) are correctly stored and accessible to the picker.
* xDS ConfigSelector changes (#8740): Updated the xDS resolver to
propagate the auto_host_rewrite flag from the Route Configuration to the
Load Balancer via the ConfigSelector.

RELEASE NOTES: 
* xDS: Added support for the :authority rewriting (gRFC A81). When
`autoHostRewrite` is enabled in the xDS RouteConfiguration, the client
will rewrite the HTTP/2 :authority header to the value of the selected
endpoint's hostname.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: xDS Includes everything xDS related, including LB policies used with xDS. Type: Feature New features or improvements in behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants