Skip to content

xds: decouple A76 and A86 EDS metadata parsing#8875

Merged
arjan-bal merged 3 commits intogrpc:masterfrom
atollena:decouple-a76-a86-metadata
Feb 20, 2026
Merged

xds: decouple A76 and A86 EDS metadata parsing#8875
arjan-bal merged 3 commits intogrpc:masterfrom
atollena:decouple-a76-a86-metadata

Conversation

@atollena
Copy link
Copy Markdown
Collaborator

@atollena atollena commented Feb 2, 2026

The EDS metadata parsing was inadvertently coupling the A76 (ring hash
endpoint hash key) and A86 (HTTP CONNECT) features. When either
GRPC_XDS_ENDPOINT_HASH_KEY_BACKWARD_COMPAT was false (A76 enabled) or
GRPC_EXPERIMENTAL_XDS_HTTP_CONNECT was true (A86 enabled), the code would
parse all metadata including TypedFilterMetadata with converters.

This caused issues because:

  • A76 only needs FilterMetadata["envoy.lb"] for hash_key extraction
  • A86 needs TypedFilterMetadata with converters (e.g., for
    envoy.config.core.v3.Address) which can fail validation

When A76 was enabled but A86 was disabled, invalid proxy addresses in
TypedFilterMetadata would still cause NACKs, even though the user didn't care
about HTTP CONNECT.

This change makes TypedFilterMetadata processing conditional on
GRPC_EXPERIMENTAL_XDS_HTTP_CONNECT, so that A76 can be enabled independently
without triggering A86-specific validation failures.

RELEASE NOTES:

  • Fix a bug where enabling A76 ring hash endpoint hash key feature
    would cause EDS resources to be NACKed if they contained invalid proxy address
    metadata, even when HTTP CONNECT (A86) was not enabled.

@atollena atollena requested a review from easwars February 2, 2026 14:05
@atollena atollena added Area: xDS Includes everything xDS related, including LB policies used with xDS. Type: Bug labels Feb 2, 2026
@atollena atollena added this to the 1.80 Release milestone Feb 2, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.60%. Comparing base (9d8ede9) to head (d6f04d4).
⚠️ Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
internal/xds/xdsclient/xdsresource/metadata.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8875      +/-   ##
==========================================
- Coverage   83.31%   80.60%   -2.72%     
==========================================
  Files         414      416       +2     
  Lines       32805    33500     +695     
==========================================
- Hits        27333    27002     -331     
- Misses       4067     4677     +610     
- Partials     1405     1821     +416     
Files with missing lines Coverage Δ
...nternal/xds/xdsclient/xdsresource/unmarshal_eds.go 96.05% <ø> (+1.31%) ⬆️
internal/xds/xdsclient/xdsresource/metadata.go 62.50% <50.00%> (-26.98%) ⬇️

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

@atollena atollena removed the request for review from easwars February 2, 2026 14:46
@arjan-bal arjan-bal self-assigned this Feb 3, 2026
Copy link
Copy Markdown
Contributor

@arjan-bal arjan-bal left a comment

Choose a reason for hiding this comment

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

LGTM! Adding a second reviewer.

@arjan-bal arjan-bal assigned easwars and unassigned arjan-bal Feb 3, 2026
@arjan-bal
Copy link
Copy Markdown
Contributor

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively decouples the A76 (ring hash endpoint hash key) and A86 (HTTP CONNECT) features in EDS metadata parsing. The change correctly makes TypedFilterMetadata processing conditional on GRPC_EXPERIMENTAL_XDS_HTTP_CONNECT, preventing unwanted validation failures when only A76 is enabled. The code is clean and the added tests cover some important scenarios. I've suggested one additional test case to explicitly verify the fix for the bug that motivated this change.

Comment thread internal/xds/xdsclient/xdsresource/unmarshal_eds_test.go
@atollena atollena removed their assignment Feb 4, 2026
The EDS metadata parsing was inadvertently coupling the A76 (ring hash
endpoint hash key) and A86 (HTTP CONNECT) features. When either
GRPC_XDS_ENDPOINT_HASH_KEY_BACKWARD_COMPAT was false (A76 enabled) or
GRPC_EXPERIMENTAL_XDS_HTTP_CONNECT was true (A86 enabled), the code would
parse all metadata including TypedFilterMetadata with converters.

This caused issues because:
- A76 only needs FilterMetadata["envoy.lb"] for hash_key extraction
- A86 needs TypedFilterMetadata with converters (e.g., for
  envoy.config.core.v3.Address) which can fail validation

When A76 was enabled but A86 was disabled, invalid proxy addresses in
TypedFilterMetadata would still cause NACKs, even though the user didn't care
about HTTP CONNECT.

This change makes TypedFilterMetadata processing conditional on
GRPC_EXPERIMENTAL_XDS_HTTP_CONNECT, so that A76 can be enabled independently
without triggering A86-specific validation failures.

Also adds test coverage for the previously untested combination of
GRPC_EXPERIMENTAL_XDS_HTTP_CONNECT=true with
GRPC_XDS_ENDPOINT_HASH_KEY_BACKWARD_COMPAT=true.

Release-note: Fix a bug where enabling A76 ring hash endpoint hash key feature
would cause EDS resources to be NACKed if they contained invalid proxy address
metadata, even when HTTP CONNECT (A86) was not enabled.
@atollena atollena force-pushed the decouple-a76-a86-metadata branch from 422ff7b to 7ce62c9 Compare February 5, 2026 08:04
@easwars
Copy link
Copy Markdown
Contributor

easwars commented Feb 5, 2026

When A76 was enabled but A86 was disabled, invalid proxy addresses in
TypedFilterMetadata would still cause NACKs, even though the user didn't care
about HTTP CONNECT.

Curious. Why does your control plane send invalid proxy addresses in the first place?

@easwars
Copy link
Copy Markdown
Contributor

easwars commented Feb 5, 2026

@atollena I discussed this with @markdroth and this is what he had to say:


I agree that that is probably sub-optimal behavior. In principle, we should probably do something like use the env var to control whether each of the metadata types is registered with the parser, so that even if we parse the metadata map itself, we'll ignore any entry whose type is not enabled by the env var.

That having been said, I'm not sure this is worth fixing, since we're eventually going to enable the A86 changes and drop the env var guard, and at that point they'll need to fix their control plane to provide valid data anyway. So it may be better for them to just do that now and not make a change that will ultimately just be temporary.


What do you think?

@atollena
Copy link
Copy Markdown
Collaborator Author

atollena commented Feb 6, 2026

When A76 was enabled but A86 was disabled, invalid proxy addresses in
TypedFilterMetadata would still cause NACKs, even though the user didn't care
about HTTP CONNECT.

Curious. Why does your control plane send invalid proxy addresses in the first place?

I only discovered this in the unit tests of grpc-go, which tests the case of invalid proxy addresses that shouldn't fail parsing if A86 is disabled, but it turns out that without this PR, the A76 env var also enables this new behavior.

My goal was just to clean up the env var guards for A76 by first enabling them by default, but that would currently enable the address parsing of A86 for all grpc-go users, which doesn't seem right.

What do you think?

I think the change in this PR is a reasonable fix: only parse typed fields if A86 is enabled, since this is the first gRFC to add typed fields. Only enable string types parsing if A76 is enabled (I don't think it can fail).

@easwars
Copy link
Copy Markdown
Contributor

easwars commented Feb 11, 2026

Apologies for the delay on this one. I'm a bit tied up with something this week. Will try to get to this asap. Thanks.

@easwars
Copy link
Copy Markdown
Contributor

easwars commented Feb 13, 2026

@atollena

What do you think about registering the parser for A86 only when the env var is enabled? This is currently done unconditionally here:
https://github.com/grpc/grpc-go/blob/master/internal/xds/xdsclient/xdsresource/metadata.go#L29

I think this should make the unit test failure that you are running into go away.

Also, we have already started working on the implementation of A83, and it would be nice to follow the same approach there of registering the parser only when the corresponding env var is enabled. Otherwise, we will be stuck inside of validateAndConstructMetadata checking for multiple env vars.

@easwars easwars assigned atollena and unassigned easwars Feb 13, 2026
@atollena
Copy link
Copy Markdown
Collaborator Author

@atollena

What do you think about registering the parser for A86 only when the env var is enabled? This is currently done unconditionally here: https://github.com/grpc/grpc-go/blob/master/internal/xds/xdsclient/xdsresource/metadata.go#L29

I think this should make the unit test failure that you are running into go away.

Also, we have already started working on the implementation of A83, and it would be nice to follow the same approach there of registering the parser only when the corresponding env var is enabled. Otherwise, we will be stuck inside of validateAndConstructMetadata checking for multiple env vars.

Understood, I took your suggestion. I also added a test helper to unregister converters.

@atollena atollena assigned easwars and unassigned atollena Feb 17, 2026
Copy link
Copy Markdown
Contributor

@easwars easwars left a comment

Choose a reason for hiding this comment

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

Apologies for the delay.

@easwars easwars assigned atollena and unassigned easwars Feb 19, 2026
@arjan-bal arjan-bal merged commit 19e4128 into grpc:master Feb 20, 2026
14 checks passed
@atollena atollena deleted the decouple-a76-a86-metadata branch February 20, 2026 10:20
This was referenced Apr 23, 2026
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: Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants