Skip to content

feat(grpc-xds): gRFC A74 model validated xDS resources and XdsConfig snapshot - #2775

Merged
YutaoMa merged 6 commits into
grpc:masterfrom
YutaoMa:yutaoma/grpc-xds-config
Aug 13, 2026
Merged

feat(grpc-xds): gRFC A74 model validated xDS resources and XdsConfig snapshot#2775
YutaoMa merged 6 commits into
grpc:masterfrom
YutaoMa:yutaoma/grpc-xds-config

Conversation

@YutaoMa

@YutaoMa YutaoMa commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Motivation

Ref: #2754

Per gRFC A74, to avoid config tear across xDS layers, all watches (LDS, RDS, CDS, EDS) are moved into a single resolver behind an XdsDependencyManager that emits a single complete XdsConfig.

Solution

This PR implements the XdsConfig modeling, along with its xDS resource types(the validated types corresponding to the Envoy proto types) and validation logic. This PR is a pre-req to the XdsDependencyManager.

The shape of XdsConfig closely mirrors gRFC A74's C++ sketch, as well as other gRPC implementations such as grpc-go. A few design choices were made for Rust ergonomics, such as using an index to store selected virtual host rather than a reference to avoid self-referential borrow.

@YutaoMa
YutaoMa marked this pull request as ready for review July 28, 2026 22:47
@YutaoMa

YutaoMa commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ejona86 @dfawley looking for reviews on this XdsConfig PR. Thanks!

@dfawley dfawley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great overall, thanks! I've found a handful of things that should be fixed, but it should all be pretty small.

Comment thread grpc-xds/src/xds_config.rs
Comment thread grpc-xds/src/resource/route.rs
Comment thread grpc-xds/src/xds_config.rs
Comment thread grpc-xds/src/resource/listener.rs
Comment thread grpc-xds/src/resource/route.rs
Comment thread grpc-xds/src/resource/listener.rs
Comment thread grpc-xds/src/resource/endpoint.rs Outdated
Comment thread grpc-xds/src/resource/route.rs Outdated
Comment thread grpc-xds/src/resource/cluster.rs
@YutaoMa

YutaoMa commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@dfawley all prev comments addressed, ready for another round of review. Thanks!

@dfawley dfawley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure about this health enum, but aside from that everything LGTM. Thanks!

// `HealthStatus` is an open enum, so a newer control plane can send
// a status this build does not know. Per gRFC A27 only HEALTHY and
// UNKNOWN are usable, so an unrecognized status fails closed.
other => Self::Other(i32::from(other)),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume our other languages are treating anything outside this range as UNKNOWN, which would then cause us to use it? That seems wrong to me, but then this is a behavior difference. But also I think if envoy ever added values to this enum, it would cause some trouble.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, for clarification the other languages also handles a out of range status as a special error case. UNKNOWN is genuinely only used for when status equals UKNOWN. The previous commit of this PR made the mistake of converting out of range to unknown, the current commit matches other langs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, it sounds like you're right. Go explicitly checks for UNKNOWN or HEALTHY, and per the proto spec, this is an open enum that is expected to represent out of range values directly in the field itself. I didn't realize that had changed from proto2 behavior. Thanks for clarifying.

@YutaoMa
YutaoMa merged commit b49f80c into grpc:master Aug 13, 2026
27 checks passed
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