Skip to content

fix(xds): port-alias and TCP-floor clusters get their own EDS resource name, so a later-added one is not deduplicated into 15 s of warming (#1013) - #1029

Merged
bpalermo merged 1 commit into
mainfrom
fix/1013-alias-floor-eds-name
Sep 28, 2026

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Mechanism

  1. Two cluster kinds subscribed to the bare-service EDS name (<ns>/<svc>) that the default service cluster already holds:
    • port aliases <fqdn>:<port> (buildPortAliasesLocked: the ODCDS cold-path authorities, e.g. the mesh port :18081 and the default port);
    • the TCP floor tcp:<fqdn> and its primary-port alias tcp:<fqdn>:<port> (captureTCPClusters / tcpPortClustersLocked, plus the edge's edgeTCPClusters).
  2. Envoy's delta-ADS WatchMap deduplicates subscription interest per (type_url, resource name).
  3. A sibling added in a later CDS update than the default cluster therefore adds nothing to resource_names_subscribe. Two ways this happens:
    • a Service gains a port after the node already depends on it;
    • a service joins the capture TCP set (a TCPRoute is attached) after it is in the dependency set.
  4. The control plane correctly sends nothing, because the resource did not change. The sibling warms for the full 15 s initial_fetch_timeout. For a floor, tcp_proxy (which has no cold path) closes every captured connection during that time.

Today this usually stays hidden because the siblings arrive in the same CDS response as the default cluster. It is the #1008 mechanism, on the two other cluster kinds that shared the name.

Fix: one mechanism, shared with the QUIC twins

  • proxy.QUICLoadAssignmentFrom is generalised to proxy.LoadAssignmentAlias(base, name). Twins, aliases and floors all use it now; the QUIC call sites, tests and docs are renamed.
  • Port aliases: NewServiceCluster(alias, alias, …), with a new clusterEntry.bareEDSAlias. clustersEndpointsAndVhosts (via the new appendEntryCLAsLocked) republishes whatever the bare name resolves to (bareServiceCLALocked) under the alias name. Because the copy is derived at snapshot time, every endpoint or health change of the default cluster, and a retained or emptied default, carries through with no second copy to keep in sync.
  • TCP floors: tcp:<fqdn> and the primary alias tcp:<fqdn>:<port> use NewTCPServiceCluster(name, name, svc). captureTCPClusters and edgeTCPClusters now return (clusters, clas), so a floor and its load assignment always ride the same snapshot.
  • TCP per-port clusters keep their port-filtered membership. Their load assignment is renamed from the HTTP spelling <fqdn>:<port> to the cluster's own name, tcp:<fqdn>:<port>. Once HTTP aliases publish under <fqdn>:<port>, the old spelling would collide when a split-protocol service serves the same port as HTTP default and raw TCP. The unit sweep includes that case, and I watched it fail with the old name: the CLA was published twice and the EDS name was shared by 2.
  • Determinism: generateSnapshot re-sorts EDS after appending the floor CLAs. The unit tests regenerate with no input change and require byte-identical CDS and EDS.

Gates (each seen red)

  1. Unit, //agent/internal/xds/cache (alias_floor_eds_test.go):

    • TestLatePortAliasSubscribesToItsOwnEDSResource: the default port moves from 18081 to 8080 in a later snapshot, which adds a :8080 alias beside :18081.
    • TestLateTCPFloorSubscribesToItsOwnEDSResource: a split-protocol service joins the capture TCP set later, which adds tcp:<fqdn> and tcp:<fqdn>:9000.

    Both assert that each cluster's EDS name is its own and differs from the bare name, and that a CLA under that name equals the base in every field except the name, in the same snapshot, under a new EDS version, with byte-identical regeneration.

    TestNoNonDefaultClusterSharesTheBareServiceEDSName sweeps a snapshot that contains default, per-port, alias, TCP floor, TCP alias, TCP per-port and QUIC twin clusters. It requires one subscriber per EDS name, a published CLA for every subscription, and no CLA published twice. It also checks that every kind is present, so the test cannot pass vacuously.

    Red on main: I ran the new tests against origin/main's cache and proxy sources. All three fail, for example echo.demo.aether.internal:8080 shares the default cluster's bare-service EDS name, tcp:mixed.aether-test.aether.internal shares …, and in the sweep [tcp:… mixed…:8080 tcp:…:9000 mixed…:18081] should have 1 item(s), but has 5.

  2. Live, //test/mtlspool (alias_floor_eds_test.go, the fix(quic): give every twin cluster its own EDS resource name so a twin added after its base is not deduplicated into 15 s of warming (503/NC) (#1008) #1012 delta-ADS harness):

    • Setup: default cluster active, then snapshot 2 adds the sibling. The alias is probed through a cluster_header route. The floor is probed through a real tcp_proxy listener carrying raw TCP, which forwards an HTTP/1.1 request to the destination.
    • Siblings are built with production's builders on production's EDS names and alt_stat_names. Transport sockets are left off.
    arm first forward left warming cluster.demo/echo.init_fetch_timeout
    TestLatePortAliasGetsEndpointsPromptly 55 ms 58 ms 0
    TestLatePortAliasWithSharedEDSNameStaysWarming (negative control, kept) 15.04 s 15.04 s 1
    TestLateTCPFloorGetsEndpointsPromptly 56 ms 59 ms 0
    TestLateTCPFloorWithSharedEDSNameStaysWarming (negative control, kept) 15.02 s 15.02 s 1
    • The xDS trace shows SUBSCRIBE add=[echo.demo.aether.internal:18081] and SUBSCRIBE add=[tcp:echo.demo.aether.internal] in the fixed arms.
    • The shared arms send no subscribe after snapshot 2, and the proxy logs initial fetch timed out for …ClusterLoadAssignment. That is the fleet signature.
  3. //test/envoy_validate:

    • The capture_tcproute and capture_tlsroute fixture floors now use their own EDS name. The quic_outbound fixture gains the mesh-port alias beside the default cluster and the twins. All fixtures still pass envoy --mode validate.
    • New ClustersSharingServiceEDSName check: no EDS cluster except a service's default (<svc>.<ns>.<domain> on <ns>/<svc>) may subscribe to a name other than its own, and no name may have two subscribers. It runs over every fixture inside TestEnvoyValidate.
    • TestNoNonDefaultClusterSharesTheServiceEDSName rewrites every alias, floor and twin back to the bare name and requires each one to be flagged, with minimum kind counts so it cannot pass vacuously.
    • Red: with the fixture builders reverted to the bare name, both tests fail on all three fixtures ([tcp:l4-a… tcp:l4-b…], [tcp:l4-tls-front… tcp:l4-tls-a… tcp:l4-tls-b…], [echo.demo.mesh.local:18081]).

Also run: bazel test //agent/... //test/... (38/38), --config=race on //agent/internal/xds/cache:all and //agent/internal/xds/proxy:all, lint with fail_on_violation (green after splitting out appendEntryCLAsLocked for gocognit), //:format and gazelle.

Docs

docs/runbook.md updates the invariant paragraph to cover all three cases: #842 SDS, #1008 EDS twins, and #1013 aliases and floors. It covers:

  • the one mechanism (LoadAssignmentAlias);
  • the /config_dump rule: only the default cluster may carry service_name: <ns>/<svc>;
  • the three gates;
  • the fleet gate, with its real matcher.

The fleet gate needed a different matcher than the issue assumed. Aliases, floors and per-port clusters keep the default cluster's alt_stat_name (the bare <ns>/<svc>). Their stats land in cluster.<ns>/<svc>.*, so aether_cluster=~"tcp:.*|.*:[0-9]+" matches nothing. The live harness confirmed this: it read the late alias's and floor's timeout at cluster.demo/echo.init_fetch_timeout. The gate is:

sum(increase(envoy_cluster_init_fetch_timeout_total{aether_cluster=~"[^@]+/[^@]+"}[8h]))   # MUST be 0 (#1013 family)
sum(increase(envoy_cluster_init_fetch_timeout_total{aether_cluster=~".+@.+"}[8h]))         # MUST be 0 (#1008 twins)

A non-zero value identifies the service, not which of its clusters timed out; /config_dump and the proxy log narrow it down.

Not touched: agent/internal/xds/proxy/capture.go (the capture listener, #1007), charts/, e2e/soak/.

Closes #1013

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…e name, so a later-added one is not deduplicated into 15 s of warming (#1013)

Port-alias clusters (<fqdn>:<port>, buildPortAliasesLocked) and the TCP
floor (tcp:<fqdn> and its primary-port alias tcp:<fqdn>:<port>) subscribed
to the bare-service EDS name the default cluster already holds. Envoy's
delta-ADS WatchMap deduplicates subscription interest per (type_url,
resource name), so one added in a later CDS update than the default
cluster sent no subscribe and warmed for the full 15 s
initial_fetch_timeout -- the #1008 mechanism.

Each now subscribes to its own cluster name, and the cache republishes
the bare ClusterLoadAssignment under it in the same snapshot pass that
emits the cluster. proxy.QUICLoadAssignmentFrom is generalised to
proxy.LoadAssignmentAlias, the one helper for twins, aliases and floors.
The TCP per-port load assignment is renamed from the HTTP spelling
<fqdn>:<port> to its own cluster name, which would otherwise collide with
an HTTP :<port> alias on the same port.

Gates: cache unit tests (red on main), //test/mtlspool live arms with
shared-name negative controls (15.04 s / 15.02 s, init_fetch_timeout=1)
vs 55 ms fixed, and an envoy_validate ClustersSharingServiceEDSName check
over every fixture. Runbook: the invariant and the real fleet gate.

Closes #1013

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit ef04f9a into main Sep 28, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/1013-alias-floor-eds-name branch September 28, 2026 00:04
bpalermo added a commit that referenced this pull request Sep 29, 2026
Brings #979 up to date with 36 commits of main (demand-scoped twins #1020/#1032,
fresh-stream classifier #1033/#1035, dormant-pair ledger #1036/#1038, per-twin
EDS names #1012/#1029, the twin certificate gate #1051, the ODCDS always-answer
override, --east-west-quic-idle-timeout #1063, L4 stat keys #1043, access-log
timing #1048, the identity gate #1055, hot-restart knobs #1068 and the carried
Envoy patches) while keeping #979's intent: no allow-list, every destination in
the node's dependency set is QUIC-eligible.

Resolution:
- cache: quicServices / SetEastWestQUICServices removed. armsFor gives arms to
  every default, identity-ready, non-waypointed entry whose service is in the
  dependency set (the same rule recordQUICPair admits by, so no route names a
  twin the agent would refuse); twins stay demand-scoped. The
  destination_not_quic_enabled refusal/prune reason is gone.
- quicpairs: the dependency-set prune now waits for the pod set like the
  source prune does -- the allow-list used to force its destinations into the
  set, and without it the first snapshot after an agent restart dropped every
  restored pair (TestQUICDemandPairSurvivesAgentRestart was red).
- fan-out log: allow_listed_services dropped; observed_pairs and
  awaiting_client_cert kept.
- chart 1.0.12: eastWestQuicServices removed, eastWestQuicIdleTimeout and its
  parentShutdownTime check kept.
- e2e/eastwest-quic.sh: main's demand-scoped E1/E4c/E6 + #979's QUIC_DNS_SANS
  negative control; h2only/E3 removed; E6 dials quic-a and its idgate-* pairs
  are excluded from the driven-pair count. eastwest-quic-hotrestart.sh's h2
  control is now the weighted GAMMA split (the one h2-by-design path).
- tests, runbook, soak README, configuration.md, 038 rewritten for the
  unconditional state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
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.

xds: port-alias and TCP-floor clusters share the bare-service EDS name — a later-added one would warm 15 s under delta-ADS dedup (#1008 class)

1 participant