feat(router): allow removing the primary mux leg (re-home) for exact route control - #4244
Merged
Merged
Conversation
…route control RemoveMuxRouteByTransport refused to remove leg index 0, on the belief that the primary leg is too privileged to drop. But ping/pong/SACK and latency attribution read rg.tps[0] LIVE on each call (no cached leg reference) and the mux selector is rebuilt on removal, so the survivor compacted into index 0 transparently takes over — the exact re-home pruneDeadTransports (index-0 death) and pruneLegByConsumeRule (remote leg retire) already perform in production. The last-leg guard is the only real floor. That refusal was the one thing blocking full manual route control: with it gone, `proxy start --route` prunes the auto primary (so the leg-set is EXACTLY the pinned routes), `proxy mux set --legs <new> --prune` performs a live direct<->multihop route switch on a running app, and a single pinned route yields a genuine single-leg session. RemoveMuxRouteByTransport has no automatic caller — only the explicit RemoveMuxRoute RPC — so this is dormant until an operator asks for it. Tests: removing the primary re-homes to the promoted leg; the last-leg floor still refuses removing the sole leg.
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.
Removing a mux leg via
RemoveMuxRouteByTransportrefused index 0 (the primary), on the belief it is too privileged to drop. But ping/pong/SACK and latency attribution readrg.tps[0]live on each call (no cached leg reference), and the mux selector is rebuilt on removal — so the survivor compacted into index 0 transparently takes over. This is the exact same re-homepruneDeadTransports(index-0 death) andpruneLegByConsumeRule(remote leg retire) already perform in production; the last-leg guard is the only real floor.That refusal was the single thing blocking full manual route control. With it relaxed:
proxy start --route(feat(cli): proxy start --route pins explicit route(s) at session start #4243) now prunes the auto primary → the leg-set is exactly the pinned routes.proxy mux set --legs <new> --pruneperforms a live direct↔multihop route switch on a running app.RemoveMuxRouteByTransporthas no automatic caller — only the explicitRemoveMuxRouteRPC (CLImux rm/mux set/--route) — so this is dormant until an operator asks for it. Unit tests cover the re-home and the surviving last-leg floor; the fullpkg/routersuite passes.