Files
ziti/controller/handler_mgmt
Paul Lorenz a0e53e29d4 Auto-GC stale router links. Fixes #4005
- adds a structured xlink.LinkKey ({DialerBinding, Protocol, DestId,
  ListenerBinding}) used by all staleness and GC checks, replacing the
  pre-rendered key string each side used to pass around
- adds the CheckStaleLinks ctrl message and the `ziti ops verify stale-links`
  CLI for operator-driven, two-sided staleness verification with optional --gc,
  which acts only when both endpoints agree
- implements auto-GC via the router.link.v1 gcMode (preserve/orphaned/changed):
  the router walks its xlinks after each Apply that mutates listeners, dialers,
  or gcMode and closes one-sided-stale entries under the configured mode
- sweeps a removal under orphaned whatever the removed config said, including
  preserve, since a removal leaves no listeners and no dialers and every
  remaining link is one the router can never re-establish
- reports staleness as a three-state verdict (unknown/notStale/stale) so a side
  that cannot judge a link abstains instead of guessing; a destination absent
  from the registry's listener snapshot means "listeners unknown", not "peer has
  none", which keeps a briefly unhealthy peer from losing its live links
- rebuilds the link surface only when a listener or dialer definition actually
  moves, so a gcMode-only change no longer rebinds every listen socket
- gates CheckStaleLinks on a new RouterStaleLinkCheck capability and explains
  each unqueryable endpoint, including one left unasked by the filter, so a
  partial verdict says which of the three causes applies
- detects a peer re-advertising the address a link was dialed to from the
  dialing side, not just from the peer's own listener side
- pins every verdict to the link iteration it was computed against, faults that
  iteration rather than the current one, and takes the conditional removal's
  result as the decision, so a link re-dialed while the sweep was running is
  neither closed nor reported as collected
- resolves which side a report speaks for from the sending router against the
  controller's link map rather than from the side the report names, so one
  router cannot fill both sides and satisfy the both-agree rule --gc depends on
- bounds the query fan-out with a semaphore, matching the other validation
  sweeps, since each query carries a minute-long reply timeout
- fails the CLI when the result stream ends before every link is reported, and
  drains results already buffered before declaring any missing
- rejects an unrecognized match mode rather than resolving it to changed, the
  broadest removal criterion
- consolidates the controller-managed router configuration changelog into one
  section, replacing the status that said routers do not yet consume configs at
  runtime, and documents the per-config-type opt-in
- restores the Current Beta Features section, dropped when the 2.0 changelog was
  archived, and lists controller-managed router configuration in it
- adds unparseable to the codespell ignore list, a spelling variant the
  dictionary flags as a typo

For #3743.
2026-09-11 15:56:22 -04:00
..