Skip to content

fix: Recover sidecar routes after galactic-cni reloads the eBPF datapath - #610

Merged
privateip merged 1 commit into
mainfrom
fix/issue-609
Sep 25, 2026
Merged

privateip merged 1 commit into
mainfrom
fix/issue-609

Conversation

@privateip

Copy link
Copy Markdown
Collaborator

Summary

When galactic-cni reloaded the shared eBPF datapath, vpc-vrf-sidecar kept its veths on the old program and never rewrote its routes, so affected traffic looped until the sidecar restarted. The sidecar now notices a reload within one sweep interval (5s by default) and reapplies every live VRF and route. Detection compares the kernel IDs of the pinned program and route map, so it only writes when something actually changed.

Test plan

  • After a datapath reload, routes whose EndpointSlices did not change are reinstalled and traffic stops looping
  • With no reload, sweeps make no kernel writes
  • A failed reapply retries on the next sweep; routes in teardown grace are not revived

Fixes #609

🤖 Generated with Claude Code

vpc-vrf-sidecar wrote kernel state only on EndpointSlice changes and ensured a VRF's datapath only when first creating it. When galactic-cni reloaded the shared eBPF datapath (re-pinning usid_egress on every load, and recreating the maps empty on a schema change), the sidecar's veths kept the old program and its orphaned maps, and new route writes landed in maps nothing on those veths read. A miss falls through to the VRF default route and loops, and nothing recovered it short of a sidecar restart.

Each sweep now reads the kernel IDs of the pinned usid_egress program and egress_route_table map. When either differs from the one the sidecar's writes went into, it re-runs EnsureVRF and EnsureRoute for every live VRF and route, re-registering map entries and re-attaching the current program. Routes in their teardown grace period are left alone, a partial failure retries on the next sweep, and an unreadable generation (datapath not loaded) is a no-op. SetDesired reads the generation before its first write so a reload between seed and first sweep is still caught.

Adds a reapply_total counter and reapply_vrf/reapply_route error kinds. A root-gated integration test confirms a compatible reload changes the program ID while keeping the map ID.

Fixes #609

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@privateip
privateip requested a review from a team as a code owner September 25, 2026 17:02
@privateip
privateip merged commit a31c86d into main Sep 25, 2026
13 checks passed
@privateip
privateip deleted the fix/issue-609 branch September 25, 2026 17:23
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.

vpc-vrf-sidecar never reinstalls routes after an eBPF map reload

2 participants