Skip to content

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

Merged
bpalermo merged 4 commits into
mainfrom
fix/1008-quic-twin-eds-name
Sep 27, 2026

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Mechanism

  1. proxy.QUICClusterFrom cloned the h2 base, so every quic: twin kept the base's eds_cluster_config (the bare-service EDS name, ads: {}).
  2. Envoy's delta-ADS WatchMap deduplicates subscription interest per (type_url, resource name).
  3. A twin added after its base is subscribed (a new ServiceAccount's first pod on the node) therefore adds nothing to resource_names_subscribe: no request goes out.
  4. The control plane correctly sends nothing (the resource did not change), so the twin warms for the full 15 s initial_fetch_timeout. Every request from that SA to that destination is 503/NC.
  5. On talos rev242 this caused 1,060 client-visible 503/NC in 11 s at k6 start, with envoy_cluster_init_fetch_timeout_total{aether_cluster="aether-test/svc-1@aether-test/default"} = 1 on every node. This is Make the source-identity filter state Hashable so the mesh can drop connection_pool_per_downstream_connection #842's mechanism (SDS, fixed in fix(agent): give the certificate selector its own SDS stream (#842) #865), this time on EDS.

Fix

  • proxy.QUICClusterFrom sets the twin's eds_cluster_config.service_name to the twin's own cluster name. The config source is still ads: {}, on the same stream.
  • New proxy.QUICLoadAssignmentFrom(base, twinName) publishes the base's ClusterLoadAssignment under the twin's name. Endpoints, named endpoints and policy all come from the base, including the health status aether writes and all locality/metadata. The endpoint slice elements are shared, not deep-cloned: CLAs are never mutated after build. A test pins the CLA descriptor's field set, so a new upstream field cannot be dropped silently.
  • cache.entryTwinsAndVhost returns the twin CLAs from the same pass that produces the twins, so a new twin and its CLA always ride the same snapshot. They are emitted in sorted-identity order and re-sorted with every other CLA, so identical inputs produce byte-identical output.

This follows the pattern the per-port clusters already use: a cluster that must not share EDS membership gets its own EDS name.

Why not a separate api_config_source (the #865 shape)

A separate source would add a mux per twin set and reintroduce a SotW/delta split for endpoints. A distinct resource name costs one extra CLA copy per twin on the existing stream, and go-control-plane's delta cache serves distinct names independently. No blocker to the preferred fix came up.

Gates (each seen red)

  1. Unit: //agent/internal/xds/cache TestQUICTwinsSubscribeToTheirOwnEDSResource. It uses ≥2 local identities, then adds a third identity in a later snapshot, and checks:

    • (a) each twin's EDS name is its own cluster name and differs from the base's;
    • (b) a CLA exists under every twin name, with endpoints equal to the base's;
    • (c) the new twin's CLA is in the same snapshot as the twin, under a new EDS version, and regeneration is byte-identical.

    Red on main: I reverted cluster.go and egress.go and the test failed on (a) for every twin and on (c) ("the new identity's twin load assignment must ride the SAME snapshot as the twin").

  2. Live: //test/mtlspool quic_twin_eds_test.go runs the pinned proxy against the go-control-plane snapshot cache over DELTA_GRPC ADS (the existing Make the source-identity filter state Hashable so the mesh can drop connection_pool_per_downstream_connection #842 harness; launchEnvoyOverADS was extracted from startEnvoyOverADS, and the xDS trace now also logs EDS). It publishes base + twin(source-a), waits until both serve 200 via a cluster_header route, then publishes a new snapshot adding twin(source-b). The twin is production's QUICClusterFrom/QUICLoadAssignmentFrom output with only the transport swapped to cleartext h2; the EDS shape is untouched.

    • TestLateQUICTwinGetsEndpointsPromptly (green): the late twin served its first 200 after 57 ms and left warming after 60 ms, with init_fetch_timeout=0 (budget 3 s). The trace shows the new SUBSCRIBE add=[quic:…@demo/source-b] and its response.
    • TestLateQUICTwinWithSharedEDSNameStaysWarming (red arm, kept as a permanent negative control): with the pre-fix shape (twin on the base's EDS name, no twin CLA), the twin served its first 200 only after 15.05 s and left warming after 15.05 s, with init_fetch_timeout=1. No EDS subscribe was sent after snapshot 2, and the proxy logged gRPC config: initial fetch timed out for type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment, exactly the fleet signature. The test asserts this outcome, so the harness is proven able to see the defect.
  3. envoy_validate: quic_outbound_bootstrap.json still passes envoy --mode validate. The new QUICUpstreamsSharingEDSName check (TestQUICUpstreamsHaveTheirOwnEDSName) runs over the fixture bytes. Its anti-vacuity half rewrites every twin back to the shared name and requires each one to be flagged.

Also run: bazel test //agent/... //test/... (38/38 pass), --config=race on //agent/internal/xds/cache:all and //agent/internal/xds/proxy:all, lint with fail_on_violation, and //:format.

Docs

Follow-ups (not in this PR)

  • The next soak must include a mid-run pod start with a new ServiceAccount. Today's churn set never introduces one, which is why 8 h of churn showed nothing after the first 11 s. That change belongs in e2e/soak/ as a separate PR. The fleet gate is envoy_cluster_init_fetch_timeout_total on @ clusters = 0 across the run.
  • While auditing I found two other kinds of cluster that still share the bare-service EDS name with the default cluster: port alias clusters (buildPortAliasesLocked) and TCP floor clusters (capture.go). Either would hit the same dedup if it were ever added in a later CDS update than its default cluster. I have not checked whether that happens in practice; it is worth its own issue.

Closes #1008

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

A `quic:` twin cloned its h2 base's eds_cluster_config, so both clusters
subscribed to the same EDS resource name on the same delta-ADS mux. Envoy's
WatchMap deduplicates interest per (type_url, resource name): a twin added
after its base was subscribed (a new ServiceAccount's first pod on the node)
sent no subscribe, the control plane had nothing to answer, and the twin
warmed for the full 15 s initial_fetch_timeout -- 503/NC from that source to
every QUIC destination. #842's mechanism, on EDS.

proxy.QUICClusterFrom now points the twin at its own EDS name (the twin's
cluster name), and the cache publishes the base's ClusterLoadAssignment under
every twin's name in the same snapshot that introduces the twin
(proxy.QUICLoadAssignmentFrom: endpoints/named endpoints/policy shared with
the base, field set pinned by a test).

Gates:
- cache: TestQUICTwinsSubscribeToTheirOwnEDSResource (red on main).
- mtlspool, live delta ADS against the pinned proxy: a late twin serves in
  57 ms; the negative control with the old shared name reproduces 15.05 s of
  warming, init_fetch_timeout=1 and the proxy's "initial fetch timed out for
  ...ClusterLoadAssignment".
- envoy_validate: QUICUpstreamsSharingEDSName over the QUIC fixture, with an
  anti-vacuity rewrite back to the shared shape.

Docs: runbook troubleshooting entry + fleet gate query, 038 Phase 4b row.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit b29a1dd into main Sep 27, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/1008-quic-twin-eds-name branch September 27, 2026 21:03
bpalermo added a commit that referenced this pull request Sep 27, 2026
…ut gate, so the soak can see the #1008 class (#1014) (#1024)

The churn set only ever rolls workloads whose ServiceAccount the node has
already seen, so an 8h soak never makes a node proxy build clusters for a
new identity -- the exact case that cost rev242 1,060 x 503/NC (#1008, fixed
in #1012) and was visible only because the k6 loaders happened to start
58 s before T0.

churn.sh gains a new-sa step (T0+126 and T0+288 by default,
SOAK_NEWSA_OFFSETS): it creates a ServiceAccount + ConfigMap + 1-replica
Deployment named sa-new-<epoch> in aether-test, pinned round-robin to a
Ready worker, whose pod (newsa-client.sh, busybox sh + curl in the
already-resident curlimages/curl:8.22.0) drives ~20 rps at svc-1 (QUIC) and
svc-3 (h2) for 120 s with user agent aether-soak-newsa/<step>, tallying
ok/non2xx/connerr per destination every 10 s plus a final AETHER_METRIC
newsa_tally line. The driver copies the tallies into the churn log, deletes
the three objects together and logs ROLLED newsa/<step> <node> <tally>, or
FAILED newsa/... (a gate finding, not an abort) when anything was not a
2xx. A step with no tally at all aborts like a failed roll.
--new-sa-once runs one step now and exits (pre-run check, kind exercise).

README: the step, its gate (init_fetch_timeout on @ clusters == 0, with the
max_over_time companion because increase() reads 0 for a series born at 1,
plus zero 503/NC for the new-SA user agent in VictoriaLogs), rev242 as the
negative control, how a FAIL reads, and a zero-reading-gates table.

Closes #1014


Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Co-authored-by: Claude Fable 5.1 <[email protected]>
bpalermo added a commit that referenced this pull request Sep 27, 2026
Brings in #1016 (repository-cache keys, cache-save: false, ci-bazel-warmup
first steps), #1019 and #1012. publish.yaml keeps both sides: the #1016
setup-bazel cache settings and warm-up step, then the release-environment
Quay robot login.

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

1 participant