Repository navigation
fix(agent,registry): ghost sweep diffs against authoritative listing, not the watch cache - #149
Merged
Merged
Conversation
… not the watch cache The reconnect re-assert (#145) reused the ghost sweep, which listed endpoints via the registrar client's ListAllEndpoints — served from the watch-fed local cache. A fresh or failed-over registrar with an EMPTY snapshot emits no FULL_SNAPSHOT events, so that cache is never cleared: it remains a stale superset claiming every pod is registered, the diff concludes nothing is missing, and the re-assert silently no-ops — defeating exactly the state-loss repair it exists to provide. Observed in vivo (2026-06-11, backend-comparison e2e): switching the registrar's external backend left the new registry with zero services while every agent kept serving stale EDS; only restarting the agents (fresh cache = server truth) healed it. A registrar fleet replacement or backend data loss would hit the same latent gap. Fix: new registry.AuthoritativeLister capability — list from the authoritative source, bypassing any cache. The registrar client implements it via the existing ListAllEndpoints RPC; the ghost sweep prefers it when present. Cost: one RPC per sweep/reconnect per node, served from the registrar's in-memory snapshot. Regression test reproduces the stale-superset trap. Co-Authored-By: Claude Opus 4.8 <[email protected]>
bpalermo
added a commit
that referenced
this pull request
Jun 12, 2026
…ase 2) WatchEndpointsRequest gains a ServiceFilter: a filtered watch receives the snapshot and incremental events for its services only. Unset filter = full watch; explicitly empty = watch nothing (a node with no mesh pods). The broadcaster indexes subscribers by service, so an endpoint change fans out to its consumers instead of every node. The agent asserts its dependency set as the filter at PreListen and re-asserts it on every refresher reload (no-op when unchanged); a changed filter cancels the live stream and reconnects with a cleared resume token, since newly in-scope services were never delivered to the old stream. Filter re-assertion on reconnect follows the same discipline as endpoint re-assertion (#149). New gauge: aether.registrar.watch.filtered_subscribers. Co-Authored-By: Claude Opus 4.8 <[email protected]>
bpalermo
added a commit
that referenced
this pull request
Jun 12, 2026
…ase 2) (#162) WatchEndpointsRequest gains a ServiceFilter: a filtered watch receives the snapshot and incremental events for its services only. Unset filter = full watch; explicitly empty = watch nothing (a node with no mesh pods). The broadcaster indexes subscribers by service, so an endpoint change fans out to its consumers instead of every node. The agent asserts its dependency set as the filter at PreListen and re-asserts it on every refresher reload (no-op when unchanged); a changed filter cancels the live stream and reconnects with a cleared resume token, since newly in-scope services were never delivered to the old stream. Filter re-assertion on reconnect follows the same discipline as endpoint re-assertion (#149). New gauge: aether.registrar.watch.filtered_subscribers. Co-authored-by: Claude Opus 4.8 <[email protected]>
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 bug (found by the backend-comparison e2e, 2026-06-11)
The reconnect re-assert (#145) runs the ghost sweep, which lists registry endpoints through the registrar client — served from the watch-fed local cache. On reconnect to a fresh/failed-over registrar whose snapshot is empty, zero
FULL_SNAPSHOTevents arrive, so the client cache is never cleared (processStreamonly clears on a FULL_SNAPSHOT event). The cache remains a stale superset claiming every pod is registered → the diff sees nothing missing → re-assert silently no-ops, defeating exactly the state-loss repair it was built for.In vivo: switching the registrar's backend (cloudmap → dynamodb) left the new registry at
services: 0for minutes while every agent served stale EDS — a latent mesh outage armed for the next agent restart. Onlykubectl rollout restart ds/aether-agent(fresh cache = server truth) healed it.Fix
registry.AuthoritativeListercapability: list from the authoritative source, bypassing any cache.ListAllEndpointsRPC (one call per sweep per node, served from the registrar's in-memory snapshot).Considered and rejected: unconditionally re-registering all local pods on reconnect — registrations start at mode-default health (EDS-mode = UNHEALTHY), so benign reconnects would demote healthy serving pods fleet-wide until the next liveness promotion. The authoritative diff re-registers only what's actually missing.
Validation
🤖 Generated with Claude Code