Skip to content

fix(router): Bind a VIP only to a backend address its VRF advertises - #817

Merged
privateip merged 1 commit into
mainfrom
fix/vip-binding-advertised-prefix
Oct 9, 2026
Merged

privateip merged 1 commit into
mainfrom
fix/vip-binding-advertised-prefix

Conversation

@privateip

Copy link
Copy Markdown
Collaborator

What was wrong

Since #809, galactic-router finds a VIP binding's VRF by the binding's VPC. That fixed two tenants sharing a prefix on one node, but it dropped the check that the backend address is one the VRF advertises on that node.

So a binding reports Bound for an address the node does not serve. This happens with a hand-written binding, with one generated before the backend's interface is up, and with a stale attachment address. Before #809 each of these failed with BindFailed. Now flows to that backend are lost while its status looks healthy.

What changed

  1. A binding is programmed only when the node advertises a prefix containing its backend address, from the binding's own VRF. Otherwise it reports BindFailed, naming the VPC, VRF, node and address.
  2. Deleting a binding skips this check, so a binding whose advertisement is already gone still deletes cleanly.
  3. A binding that fails the check claims no translation row, so it cannot block another binding.
  4. A new or changed advertisement on the node requeues the node's bindings. A binding written before its advertisement binds as soon as the address is advertised.

The router and gateway docs describe the new rule.

Testing

New unit tests check that a binding is:

  • Bound when its address is in an advertised prefix
  • BindFailed when its address is in no advertised prefix
  • BindFailed when only another VRF on the node advertises the prefix

Other new tests check that a binding deletes after its advertisement is gone, and that only advertisements on this node's router requeue its bindings.

Build, lint and unit tests pass. The YAML formatter's lint step fails inside a worktree, so I ran it with a temporary config that skips the repository metadata directory, and it passed. I did not run the end-to-end tests.

🤖 Generated with Claude Code

@privateip
privateip requested a review from a team as a code owner October 8, 2026 21:48
@scotwells

Copy link
Copy Markdown
Contributor

@privateip got merge conflicts

@privateip
privateip force-pushed the fix/vip-binding-advertised-prefix branch from 9baa0aa to d606d46 Compare October 8, 2026 21:53
@privateip
privateip enabled auto-merge October 8, 2026 21:54
@privateip
privateip force-pushed the fix/vip-binding-advertised-prefix branch from d606d46 to 65759b3 Compare October 9, 2026 01:51
The bind path now requires a BGPAdvertisement on this node's BGPRouter, with the VRF's ID, whose prefix contains the backend address, and otherwise fails with BindFailed naming the VPC, VRF, node and address. The VRF lookup is split out (resolveVIPBindingVRF) so teardown keeps resolving the VRF context alone and still deletes a binding whose advertisement is already gone. livePeers goes through the same check, so a peer whose backend is not served claims no row.

The reconciler now watches BGPAdvertisements that carry a VRFID and Function and maps one on this node's router to this node's bindings, so a binding written before its advertisement binds as soon as the address is advertised.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@privateip
privateip force-pushed the fix/vip-binding-advertised-prefix branch from 65759b3 to 80ec75c Compare October 9, 2026 15:34
@privateip
privateip disabled auto-merge October 9, 2026 15:55
@privateip
privateip merged commit 7ec19ba into main Oct 9, 2026
15 checks passed
@privateip
privateip deleted the fix/vip-binding-advertised-prefix branch October 9, 2026 15:55
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