Skip to content

[release-1.29] Introduce istio.hashable_string filter state factory - #6906

Merged
istio-testing merged 1 commit into
istio:release-1.29from
istio-testing:cherry-pick-6905-to-release-1.29
Mar 17, 2026
Merged

istio-testing merged 1 commit into
istio:release-1.29from
istio-testing:cherry-pick-6905-to-release-1.29

Conversation

@istio-testing

Copy link
Copy Markdown
Collaborator

This is an automated cherry-pick of #6905

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]>
@istio-testing
istio-testing requested a review from a team as a code owner March 16, 2026 21:30
@istio-testing istio-testing added the release-notes-none Indicates a PR that does not require release notes. label Mar 16, 2026
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 16, 2026
@PetrMc

PetrMc commented Mar 17, 2026

Copy link
Copy Markdown
Member

/retest

@istio-testing
istio-testing merged commit e9549a7 into istio:release-1.29 Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes-none Indicates a PR that does not require release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants