Skip to content

A103: xDS Composite Filter#511

Open
markdroth wants to merge 13 commits intogrpc:masterfrom
markdroth:xds_composite_filter
Open

A103: xDS Composite Filter#511
markdroth wants to merge 13 commits intogrpc:masterfrom
markdroth:xds_composite_filter

Conversation

@markdroth
Copy link
Member

No description provided.

@markdroth markdroth marked this pull request as ready for review September 18, 2025 22:51
- matcher: gRPC will not support this deprecated field.

We will also support per-route overrides via the
[`envoy.extensions.common.matching.v3.ExtensionWithMatcherPerRoute`
Copy link
Member

Choose a reason for hiding this comment

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

So this means we can have filters defined wholly in the RouteConfiguration? The Listener would no longer enumerate all the filters being used.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's correct.

In the future, we'll also add ECDS support, which would be another way for the Listener to not enumerate all of the filters being used, even if there is no per-route override.

Copy link
Contributor

Choose a reason for hiding this comment

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

A39 says that

  1. There must be at least one filter in the list, or the Listener resource will be NACKed. Is this no longer true ?
  2. Note that gRPC will not fail validation if the map key specifies a filter instance name that does not exist in the HttpConnectionManager filter list. This is because during an update, the xDS client code cannot know which HttpConnectionManager config is currently being used. Do we ignore such filters currently ? and will we continue doing so ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This gRFC does not modify A39 in any way. Both of those statements from A39 are still true.

copybara-service bot pushed a commit to grpc/grpc that referenced this pull request Feb 14, 2026
…oute (#40938)

Prior to this PR, we have a fairly convoluted mechanism for passing configs to xDS HTTP filters. The configs are passed via the service config, using internal-only parsing. This allows us to have a single stack of filters for all routes, where the config to use for each RPC is passed down to the filter via call context, which is set when choosing the xDS route.

That mechanism was originally chosen way back when we implemented fault injection (our first xDS HTTP filter) to hedge against the possibility that we might want the functionality to be configurable via service config when not using xDS. However, that possibility has not materialized, so there's no real advantage in doing it that way, and there are a couple of disadvantages: it requires us to convert the xDS protos first to JSON and then parse the JSON, which is fairly inefficient, and it requires a hack in our filter stack code to handle the case where there are multiple instances of the same filter in a single stack.

Now there is a new reason to change this mechanism: with the introduction of the xDS composite filter (see pending [gRFC A103](grpc/proposal#511)), the set of filters will no longer just be one-dimensional, so we would need to add more hierarchical structure to the service config representation, and we'd need to add even more hacks to the filter stack to allow each filter to figure out which part of the hierarchical service config representation to use. That complexity would push the current already-hacky approach into "untenable" territory.

I am addressing that problem by switching to a model more similar to how Java and Go do things: instead of constructing a single filter chain and passing the configs to the filters via call context, we will now have the `ConfigSelector` generate a separate filter chain for each xDS route, so that each filter can be directly passed the config to use when it is instantiated, and the `ConfigSelector` will return the filter chain to the channel when it chooses the route for each RPC.

This PR switches the client-side xDS code to use this new approach, controlled by an experiment.

For now, I am making this change on the client side only.  The server side will require a bit more work: today, there is only one filter chain for each incoming connection on the server side, so introducing a separate filter chain for each route will require us to split that up into two filter chains, and we don't currently have the machinery needed for that on the server side. For now, our priority is to get the composite filter and ext_proc working on the client side, so I am leaving the server side for a later PR.

Closes #40938

COPYBARA_INTEGRATE_REVIEW=#40938 from markdroth:filter_configs_config_selector a673a64
PiperOrigin-RevId: 869929302
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.

4 participants