Repository navigation
[release-1.29] Introduce istio.hashable_string filter state factory - #6906
Merged
istio-testing merged 1 commit intoMar 17, 2026
Merged
istio-testing merged 1 commit into
istio-testing merged 1 commit into
Conversation
This is part of the fix for istio/istio#58630 and you can find some additional context in that ticket (the other part will be to the pilot, and we'd also like to backport this change to 1.29 release branch as well). To understand why this change is needed we have to start with some background. In ambient multicluster, specifically in multi-network deployments, we rely on ambient E/W gateway to transfer data from one network to another. When communicating across network boundaries in ambient we use double-HBONE (HBONE inside another HBONE). The E/W gateway terminate the outer HBONE tunnel and transfers the inner HBONE tunnel untouched to the destination. Envoy configuration of ambient E/W gateway has two listeners important for understanding this change - `connect_terminate` and `main_internal`. `connect_terminate` listener is responsible for terminating outer HBONE tunnel, extracting and preserving all the relevant routing information (e.g. authority from HTTP CONNECT request and some headers). However, `connect_terminate` does not make any routing decisions, instead it passes all the relevant information to the internal `main_internal` listener via filter state, and then `main_internal` listener is actually responsible for routing the request correctly. To transfer data to `main_internal` listener, `connect_terminate` listener opens an "internal" connection - it's a connection implemented purely in Envoy, but it implements the same interface as any other connections that Envoy supports and for many intents and purposes is not that different from say TCP connections. One thing that is particularly important for this PR is that Envoy does connection pooling for internal connections like it does for any other connections. Connections from the same pool assumed to share the same filter state (via transport socket options) with the upstream internal listener (e.g., `main_internal` listener in our case). So if you have two HTTP2 streams with different authority in the HBONE connect requests, only authority from the stream handled first will be communicated to the upstream internal listener - that's not what we want. Envoy in principle recognizes that filter state may affect some routing decisions, so for some types of filter state objects shared with upstream Envoy can tell that it should use different connection pools to avoid mixing unrelated requests together, however `envoy.string` type we currently use to communicate authority from the HBONE CONNECT requests is not one of such types. Recently, Envoy introduced `envoy.hashable_string` that does what we need (see envoyproxy/envoy#43208), but this change didn't make it to Envoy 1.37 release branch and it will not be backported. NOTE: I checked other existing filter state object types, and they don't suit us either, so upstream Envoy `envoy.hashable_string` is basically the first and the only one that works for us. NOTE: From Envoy point of view that change is not a bug or security fix, so the fact that it should not be backported makes perfect sense, but just in case I also explicitly asked in that PR if we could backport it and got an explicit response that it's quite undesirable. So this PR introduces `istio.hashable_string` which does exactly the same thing that upstream `envoy.hashable_string` does, however we can backport it to the Istio's 1.29 release branch without relying on upstream Envoy. Eventually, we can phase it out in favor of the upstream Envoy `envoy.hashable_string`. With the current Istio release cadence, according to https://istio.io/latest/docs/releases/supported-releases/, we should be able to phase it out completely in about 2 quarters and 6 weeks. Together with the fact that the extensions is quite small, I think that it's manageable to add it to the Istio proxy repor, even if it's not ideal. Signed-off-by: Mikhail Krinkin <[email protected]>
PetrMc
approved these changes
Mar 17, 2026
Member
|
/retest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #6905