Repository navigation
test(e2e): name the stalled hop when the replicator failover assertion flakes - #599
Merged
Merged
Conversation
…n flakes The `replicator` suite intermittently fails step 3's NEGATIVE assertion: `client(a)` must stop reaching `echo` once region-b's mirror expires from etcd-a. The registry half is provably fine (the mirror expires at 0s, b's origin data persists) — what flakes is the data path outliving the registry state, and today that failure says nothing beyond "still 200". That matters more than a loose budget would suggest. The withdrawal path is watch-driven end to end: a's registrar syncs off the etcd watch with the 5s poll as a backstop (`registrar/internal/server/sync.go`, `registry/internal/etcd/etcd.go`), and the agent pushes xDS off the resulting broadcast. Designed latency is sub-second plus debounce, so exceeding 30s is ~2 orders of magnitude off the designed path, not a marginal overrun. Widening the window would bury one of three materially different causes, so instrument the hops instead. `dump_failover_state()` prints, on the failure path before `die`: - registry — region-b keys in both etcds, so the log is self-contained; - registrar — two greps of a's logs (the per-cycle `--debug` chatter would otherwise crowd the decisive lines out of a single tail): watch establish/re-establish and lease/leader/mirror lines, then the sync cadence. This is what separates "the watch lapsed and we degraded to the 5s poll" from "a replicator leader-election gap"; - agent — snapshot rebuilds and dependency-set transitions for `echo`, plus the `aether_agent_snapshot_*` metrics; - envoy — the `echo` cluster's hosts from admin `/clusters`, which proves or clears the consequential cause outright: hosts still present would mean cross-cluster failover latency is bounded by something other than the origin-heartbeat lease, defeating the design's premise. Envoy's admin binds 127.0.0.1:9901 and both images are distroless, so there is no `kubectl exec` route to it. The proxy and agent are hostNetwork, so the kind node container shares their netns and `docker exec <node> curl` reaches both admin and the agent's metrics — the same shape as the existing etcdctl dumps. Kept to a one-shot failure-path dump: `/clusters` renders on Envoy's main thread, which is why nothing in aether scrapes it. The waypoint harness has no withdrawal assertion, so the failover dump does not apply — but its `die` message literally instructed a human to "inspect a's EDS for echo", so `dump_echo_eds()` now does that too. Retry budget, timeouts, and production code are all untouched: the point is to identify the stalled hop first. Refs #597. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR
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.
The
replicatorsuite intermittently fails step 3's negative assertion —client(a)must stop reachingechoonce region-b's mirror expires from etcd-a. The registry half is provably fine (mirror expires at 0s, b's origin data persists); what flakes is the data path outliving the registry state, and today that failure says nothing beyond "still 200".That matters more than a loose budget suggests. The withdrawal path is watch-driven end to end — a's registrar syncs off the etcd watch with the 5s poll as a mere backstop (
registrar/internal/server/sync.go,registry/internal/etcd/etcd.go), and the agent pushes xDS off the resulting broadcast. Designed latency is sub-second plus debounce, so exceeding 30s is ~2 orders of magnitude off the designed path, not a marginal overrun.Widening the window would bury one of three materially different causes, so this instruments the hops instead. No timeout, retry budget, or production code is touched.
dump_failover_state()— on the failure path, beforedieecho, plusaether_agent_snapshot_*metricsechocluster's hosts from admin/clustersTwo registrar greps rather than one because the chart runs everything with
--debug, so per-cycle chatter would otherwise crowd the rare decisive lines out of any single tail.(3) is the consequential one: hosts still present would mean cross-cluster failover latency is bounded by something other than the origin-heartbeat lease, defeating the design's premise.
A final post-dump probe distinguishes "merely overran the budget" from "never withdrew" — diagnostic only, the assertion has already been decided.
Reaching the Envoy/xDS layer
Envoy's admin binds
127.0.0.1:9901and both the proxy and agent images are distroless, so there is nokubectl execroute to it. Both DaemonSets arehostNetwork, so the kind node container shares their netns anddocker exec <node> curlreaches admin and the agent's:8080metrics — the same shape as the existingetcdctldumps, andkindest/nodeships curl (verified). Kept to a one-shot failure-path dump:/clustersrenders on Envoy's main thread, which is why nothing in aether scrapes it.Waypoint harness
The failover dump doesn't apply — that suite has one shared etcd, no replicator, no registrar kill, and no withdrawal assertion. But its
diemessage literally instructed a human to "inspect a's EDS for echo", sodump_echo_eds()now does it: ~20 lines, same #590 principle, and the one hopdump_mesh_dnscannot speak for.Verification
bash -nclean on both scripts.shellcheck(via.shellcheckrc,shell=bash): zero new findings — the two reported (SC2034TUNNEL_PORT,SC2155in waypointinstall_aether) are byte-identical onHEAD.bazel run //:format+make format-checkclean.set -euo pipefailwith stubbedkubectl/docker: all-tools-failing, happy path, envoy-holds-echo, envoy-dropped-echo, and node-unresolved branches all return 0 and print the intended section.Refs #597.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR