Skip to content

fix(proxy-supervisor): re-probe a fresh predecessor instead of grabbing epoch 0 - #111

Merged
bpalermo merged 1 commit into
mainfrom
fix/init-epoch-probe-retry
Jun 10, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/init-epoch-probe-retry

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Summary

Found during the post-merge (rev-49) re-pin on talos-main, which rolled the agent and proxy DaemonSets simultaneously: under that load, a single 1s admin probe in initStartEpoch failed transiently, the new pod concluded "no live predecessor" and started at epoch 0 — colliding with the live predecessor on the base-id hot-restart domain socket (errno=98) and crash-looping (restartCount: 4 on one node) until the predecessor exited. Self-healing, but a crash-loop where a short wait should be.

Fix

The heartbeat file is LIVE-gated by construction (written only while the writer's Envoy is admin-LIVE), so a fresh heartbeat is strong evidence the predecessor is alive. initStartEpoch now requires the two signals to agree: while the file is fresh but admin unconfirmed it re-probes (500ms interval), resolving to epoch+1 when admin confirms or to epoch 0 once the heartbeat goes stale (≤8s bound). One transient probe failure can no longer trigger the epoch-0 collision.

Validation

  • Updated/added unit tests: near-stale + dead admin → re-probes then epoch 0; fresh file + transiently failing admin (2 failures then LIVE) → epoch+1.
  • talos: deployed and exercised with a simultaneous agent+proxy roll + traffic (results in PR thread).

🤖 Generated with Claude Code

…ng epoch 0

The rev-49 simultaneous agent+proxy roll on talos exposed it: under node load a
single 1s admin probe in initStartEpoch failed transiently, the supervisor
concluded "no live predecessor" and started at epoch 0 — bind-colliding with
the live predecessor on the base-id domain socket (errno 98) and crash-looping
(restartCount 4) until the predecessor yielded.

The heartbeat is LIVE-gated by construction, so a fresh heartbeat means the
predecessor served within the stale window; the two signals must agree before
deciding. initStartEpoch now re-probes while the file is fresh but admin is
unconfirmed — resolving to epoch+1 when admin confirms, or to epoch 0 once the
heartbeat goes stale. The wait is bounded by predecessorStale.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@bpalermo

Copy link
Copy Markdown
Owner Author

talos-main validation (rev 50, fixed image 44e54be5)

Reproduced the rev-49 failure condition — a simultaneous agent+proxy DaemonSet roll — under live traffic, plus a ConfigMap in-place hot restart:

  • maxRC=0 through both windows (rev-49 had restartCount: 4 on one node from the epoch-0 collision)
  • 4000/4000 mesh requests, zero failures (loop covered the simultaneous roll)
  • 5/5 updated + ready; rev-50's own deploy roll (also simultaneous) was likewise RC=0

The fix held: no epoch-0 grabs against a live predecessor.

@bpalermo
bpalermo merged commit a87b79f into main Jun 10, 2026
10 checks passed
@bpalermo
bpalermo deleted the fix/init-epoch-probe-retry branch June 10, 2026 12:15
bpalermo added a commit that referenced this pull request Jun 10, 2026
…#120)

- docs/workload-requirements.md: how a workload joins the mesh (SA-derived
  service name, managed label, annotations), the outbound listener calling
  convention, the two workload-side settings required for hitless rolls
  (minReadySeconds, native preStop sleep) with the validated termination
  sequence, and the exact retry semantics clients get for free.
- 002 audit doc: status header was stale ("no fixes applied"); all findings
  landed in #109/#110/#111.

Co-authored-by: Claude Opus 4.8 <[email protected]>
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.

1 participant