Repository navigation
fix(agent): the acknowledged SAN-pin gauge has its sample after an agent restart against a proxy that is in sync (#1483) - #1504
Merged
Conversation
…ent restart against a proxy that is in sync (#1483) aether.agent.xds.acked_tls_clusters is written when the proxy ACKs a cluster response. After an agent restart on a quiet node it had no series until a cluster next changed. The issue says no cluster response is owed there. One is sent all the same: go-control-plane answers the first wildcard request of a stream even with nothing to add or remove, and the proxy ACKs it. The agent's ACK tracker dropped every response that carried nothing, so that exchange was lost. The first Cluster request of a stream carries, in initial_resource_versions, the version of every cluster the proxy holds (a hash of the cluster's bytes). go-control-plane seeds the subscription with them and compares them with the snapshot, so an empty FIRST response says "the snapshot with this version is exactly what you stated". The tracker now keeps that response and tells its ACK to the observer like any other. Only the first response of a type on a stream. A later empty response is compared with what the server has sent on the stream, accepted or not, and go-control-plane sends one for every wildcard request without a nonce (an on-demand subscription). After a rejected update it names the rejected snapshot and is ACKed; reading it as held would be false in the state the gauge exists to show. Measured on the pinned proxy (//agent/test/mtlspool): the reconnecting proxy states every cluster it holds at the version it was sent, the empty answer is ACKed, and after a NACK the proxy states none of the versions of the rejected response. Not closed, and documented: an agent that restarts while the proxy is rejecting a cluster update has no acknowledged state to show (the proxy states clusters the new process never built), so the gauge stays absent and the divergence alert is silent there. A promtool case states it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
🟡 Changes recommended
Several updated documentation passages incorrectly imply that every Cluster ACK updates the gauge, despite later empty ACKs being deliberately ignored.
7 open findings
Correct the contract to exclude later empty ACKs · New Distinguish qualifying Cluster ACKs from empty responses · New Clarify the qualifying-response rule for gauge creation · New Specify which Cluster responses the tracker records · New Fix incorrect possessive grammar · New Clarify which Cluster ACKs update the gauge · New Clarify that later empty ACKs do not create the gauge · New
What changed in this PR
Fixes the acknowledged SAN-pin gauge after an agent restart by tracking the first empty CDS response per stream and resource type.
Changes:
- Records ACKs for stream-opening empty responses while ignoring later empty responses.
- Adds unit, cache, real-Envoy, and alert-rule coverage.
- Updates operational documentation for restart and NACK behavior.
| File | Description |
|---|---|
docs/runbook.md |
Documents gauge behavior and limitations. |
docs/observability/README.md |
Updates metric and alert guidance. |
docs/observability/agent-pin-alerts.yml |
Expands alert-rule commentary. |
docs/observability/agent-pin-alerts_test.yml |
Adds restart scenarios. |
agent/test/mtlspool/cds_reconnect_test.go |
Tests reconnect behavior with Envoy. |
agent/test/mtlspool/BUILD.bazel |
Registers the reconnect test. |
agent/internal/xds/cache/pinhistory.go |
Documents acknowledged pin history. |
agent/internal/xds/cache/pinhistory_test.go |
Tests gauge behavior across reconnects. |
agent/internal/xds/ack/tracker.go |
Tracks opening responses per stream/type. |
agent/internal/xds/ack/opening_test.go |
Tests opening and later empty responses. |
agent/internal/xds/ack/BUILD.bazel |
Registers the tracker tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… on (#1483) The ACK of an empty cluster response later on a stream is not read. The runbook, the catalog row, the rule comment and the cache comment said 'a cluster ACK' where they meant an ACK of a response that changed something or of the empty response that opens a stream. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
🟢 Approval recommended
The protocol-sensitive behavior is narrowly implemented and covered by unit, cache-level, and real-proxy tests.
0 open findings
7 resolved since last review
Clarify that later empty ACKs do not create the gauge Clarify which Cluster ACKs update the gauge Fix incorrect possessive grammar Specify which Cluster responses the tracker records Clarify the qualifying-response rule for gauge creation Distinguish qualifying Cluster ACKs from empty responses Correct the contract to exclude later empty ACKs
🧠 Review effort: Balanced
This was referenced Oct 9, 2026
This was referenced Oct 9, 2026
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.

Closes #1483
What was wrong
aether.agent.xds.acked_tls_clusters{pin,reason}is written when the proxy ACKs a cluster response. After an agent restart on a quiet node the gauge had no series until a cluster next changed.The issue says the proxy "is owed no CDS response" in that state. That is not what happens on the wire, and it is where the fix is:
respondDelta: "otherwise, envoy won't complete initialization").Can the agent truthfully conclude "the proxy holds snapshot X" from the reconnect?
Yes, from the first exchange of a stream, and only from that one.
initial_resource_versions: the version of every cluster the proxy holds. Versions are the ones the control plane sent, which for go-control-plane are SHA-256 hashes of each cluster's bytes, so a new agent process with the same clusters computes the same ones.system_version_infonames that snapshot.A later empty response is still dropped, and has to be. From its first response on, go-control-plane compares the snapshot with what it has sent on the stream, accepted or not, and it answers every wildcard request that has no nonce, which an on-demand cluster subscription is. After a rejected update that answer is empty, names the rejected snapshot, and is ACKed. Reading it as "held" would be false in exactly the state the gauge exists to show.
Measured and read
Measured on the pinned proxy, with the pinned go-control-plane server (
//agent/test/mtlspool, two new tests):subscribe=[],initial_resource_versions={held-a: d4843e…, held-b: 8e47d1…}), equal to the restarted control plane's own version map.Measured on the pinned go-control-plane cache alone (
//agent/internal/xds/cache): after a rejected cluster update the cache re-sends nothing, and a request without a nonce is answered with an empty response naming the rejected snapshot.Read from source, not measured: that Envoy records a response's versions only after the response was accepted (
DeltaSubscriptionState::handleGoodResponseat the pinned commit), which is what the NACK measurement above shows from outside; and that Envoy ACKs the later empty response (it has nothing to reject). The second was not reproduced with a real on-demand subscription.Red, then green
Tests were written first and seen failing against the unchanged tracker:
//agent/test/mtlspoolTestReconnectingProxyStatesTheClustersItHolds: the three protocol facts passed, the last assertion failed (expected: []string{"after-restart"}, actual: []string(nil)).//agent/internal/xds/ackTestAckObserver_ToldOfAnAcknowledgedEmptyOpeningResponseand…OpeningResponseIsPerStreamAndPerType: failed.The cache-level tests and the "not told" tests were added with the fix, so each was checked by mutation instead:
ack,TestAckedPinGaugeAfterAnAgentRestartAgainstAnInSyncProxyincache, and the Envoy test.TestAckObserver_NotToldOfALaterEmptyResponse,…PerStreamAndPerTypeandTestAckedPinGaugeMakesNoClaimForAProxyThatIsNotInSync.Both mutations reverted. With the change:
//agent/internal/xds/...,//agent/internal/cmd/...and the whole//agent/test/mtlspool:mtlspool_testpass;--config=racepasses onack_test,cache_testand 12 runs of the two new Envoy tests; lint (--config=lintwithfail_on_violation) andmake format-checkare clean.What this does not close
An agent that restarts while the proxy is rejecting a cluster update still has no acknowledged sample. The proxy states the clusters it held before the rejected update, which the new agent process never built and cannot count. It is sent the update again, rejects it again, and there is no acknowledgement to record.
AetherProxyHoldsUnpinnedClustersis silent in that state (a divergence that was firing resolves when the old process's samples leave the lookback). I did not invent a value for it. It is now written down in the runbook ("The unpinned-cluster signal", "Published is not held"), in the rule's comment, and as a promtool case; the NACK counter still moves.Docs and rules
docs/runbook.md: the restart behaviour, the two remaining absent states, and "acknowledged is accepted, not applied".docs/observability/README.md,agent-pin-alerts.yml: comments only, no rule expression changed.agent-pin-alerts_test.yml: two cases added (an agent restart with the proxy in sync is quiet; an agent restart while the proxy rejects silences the divergence rule). Run by hand with promtool 3.5.0:SUCCESS. The repository has no promtool target on this branch.Not verified
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr