Skip to content

fix(router): Open the VIP translation map once galactic-cni pins it - #1095

Merged
privateip merged 2 commits into
mainfrom
fix/router-vip-xlat-boot
Oct 25, 2026
Merged

privateip merged 2 commits into
mainfrom
fix/router-vip-xlat-boot

Conversation

@privateip

@privateip privateip commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

After a node reboots, a private service backed by a workload on that node can stay unreachable there until someone restarts the node's router.

The router can start before the node's datapath is ready, and it looked for the service address table only once, at startup. Every binding on that node then failed until the next restart.

The router now looks for the table when a binding first needs it, keeps retrying while it is missing, and holds on to it once found.

Test plan

  • A binding that fails before the table exists binds once it appears, with no restart
  • Concurrent first use finds the table once, and nothing reopens it after shutdown
  • Unit tests, race detector and lint pass
  • After merge, a lab compute node reboot leaves its service bindings bound

On a node that has just booted, galactic-router can start before galactic-cni pins vip_xlat_table. galactic-router opened the pin once at startup and kept no handle when that failed, so every tap-kind ServiceVIPBinding on the node failed with "vip_xlat_table is not available on this node" for the life of the process, and its VIP stayed unserved there until galactic-router restarted. The GC ticker's vip_xlat_table sweep was skipped for the same lifetime.

PinnedVIPTranslationTable opens the pin when a binding or the sweep first needs it, retries on each call while it is missing, and keeps the handle once open. The startup log still reports a missing pin, at Info on a route reflector, where galactic-cni never runs. A map that galactic-cni recreates on a layout change still needs a galactic-router restart, as the router architecture doc says.

TestServiceVIPBindingReconciler_TapBindsOncePinAppears reconciles a tap binding before the pin exists, then after, and checks that it binds without a restart and that the handle is opened once and reused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@privateip privateip self-assigned this Oct 25, 2026
The GC ticker set the shared VIPXlatSweeper's Table field on every tick.
Only that goroutine touches it today, but nothing stops a later caller from
sweeping concurrently with that write. Each tick now sweeps with its own copy
of the sweeper.

Also trim the PinnedVIPTranslationTable doc to its contract: it opens the pin
on first use, retries while the pin is missing, and keeps the handle until
Close.
@privateip
privateip marked this pull request as ready for review October 25, 2026 15:43
@privateip
privateip requested a review from a team as a code owner October 25, 2026 15:43
@privateip
privateip enabled auto-merge October 25, 2026 15:43
@privateip

Copy link
Copy Markdown
Contributor Author

Second review pass on head 67f3071: both reviewers returned merge.

pr-rereviewer: merge. It confirmed all five first-pass findings fixed. It ran go vet and go test -race on ./internal/controller and ./cmd/galactic-router, both passing, and git merge-tree against the head of open PR #1094, which merged cleanly. Its one nit, a 59-character commit subject, is waived because docs/agents/CONVENTIONS.md allows up to 72.

pr-conventions-reviewer: merge. Its warning that #1094 touches the same files is informational only, since the two merge cleanly in either order. Its nit about a component named twice in the body was fixed. Squashing the follow-up commit and rewrapping the first commit body were waived, because both need a force-push of a pushed branch.

Findings applied in the fix phase: wrong issue link dropped, unsourced figure removed, body rewritten in product terms, docstring trimmed, per-tick sweeper copy. The PR intentionally carries no issue link.

CI: every check on the head passed (Build, Lint, Unit Tests, Unit Tests (root), E2E Tests, CLA, and all image and bundle publish jobs).

Auto-merge is enabled with the merge method, the only one the ruleset allows. The ruleset requires one approving review and a code owner review, and dismisses stale approvals on push, so the PR waits for a human approval.

@privateip
privateip merged commit ac59aab into main Oct 25, 2026
18 checks passed
@privateip
privateip deleted the fix/router-vip-xlat-boot branch October 25, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants