Repository navigation
feat(agent): any-port deprecation shim with its own counter (037 Phase 2 shim) - #900
Merged
Merged
Conversation
…e 2 shim) Phase 4 proposes deleting the portless floor chain — the only step in proposal 037 that changes what an existing client observes — and gates it on evidence that no client observes it. That evidence needs a counter this implementation did not have, so Phase 4 could not be done and the shim had to be built first. A TCP-primary service's floor is now three chains, all copies of the same passthrough-or-TCPRoute-weighted chain so they cannot drift: cap_tcp_<svc>_18082 the well-known TCP mesh spelling cap_tcp_<svc>_<primary> the service's own primary port cap_tcp_anyport_<svc> portless, LAST — the shim The first two survive Phase 4. The shim, being the least specific chain, is selected only for a port that no destination_port chain claimed — which is exactly the traffic Phase 4 proposes to stop serving, and nothing else. Its separate stat prefix is the entire point. Phase 4's gate is tcp.cap_tcp_anyport_<svc>.downstream_cx_total reading zero across a full release on talos. Sharing a prefix with the supported spellings would make that counter unable to distinguish "a client depends on the deprecated behaviour" from "a client used a supported spelling", and the removal would be a guess dressed as evidence. Adding the primary-port spelling is also what makes the eventual removal narrow: after Phase 4, :18082, :<primary> and every registered TCP port still work. Only an UNREGISTERED port stops, which is the behaviour being deprecated. PHASE 4 IS NOT DONE and cannot be from here: it needs a release of readings this commit makes possible. The shim starts that clock. Negative control: giving the shim the same stat prefix as the floor fails TestAnyPortShimIsCountedSeparately with "the shim must have its own stat prefix, or Phase 4 has no evidence to act on". Chain-count assertions in capture_test.go were rewritten to assert on chain NAMES where the count was load-bearing; an index-based lookup for the HCM chain was also made name-based, since it silently asserted on whichever chain happened to be first. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
3 tasks
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.
Phase 4 cannot be done, and this is why — plus the prerequisite for doing it later.
Phase 4 proposes deleting the portless floor chain. It is the only step in proposal 037 that changes what an existing client observes, and the proposal gates it on evidence that no client observes it:
That counter did not exist in this implementation — the shim was never built, so the portless chain shared its stat prefix with every other way of reaching the floor. Phase 4 was therefore blocked twice: no evidence, and no way to gather it.
What ships
A TCP-primary service's floor is now three chains, all copies of the same passthrough-or-TCPRoute-weighted chain so they cannot drift:
cap_tcp_<svc>_18082/32+destination_port 18082cap_tcp_<svc>_<primary>/32+destination_port <primary>cap_tcp_anyport_<svc>/32only — the shimThe shim is the least specific chain, so Envoy selects it only for a port that no
destination_portchain claimed — exactly the traffic Phase 4 proposes to stop serving, and nothing else.Why the separate stat prefix is the whole point
Phase 4's gate is
tcp.cap_tcp_anyport_<svc>.downstream_cx_totalreading zero across a full release. Sharing a prefix with the supported spellings would leave that counter unable to distinguish "a client depends on the deprecated behaviour" from "a client used a supported spelling" — and the removal would be a guess dressed as evidence.Adding the primary-port spelling is also what makes the eventual removal narrow: afterwards
:18082,:<primary>and every registered TCP port still work. Only an unregistered port stops, which is the behaviour being deprecated.Negative control
Giving the shim the same stat prefix as the floor fails with "the shim must have its own stat prefix, or Phase 4 has no evidence to act on".
Also
Chain-count assertions in
capture_test.gowere rewritten to assert on chain names where the count was load-bearing. An index-based lookup for the HCM chain was made name-based too — it silently asserted on whichever chain happened to be first, which is how it broke when the blackhole chain was added.bazel build //...clean, 109 tests pass, lint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr