Repository navigation
fix(nat): remove Local pair state when Worker integration is off - #1480
Conversation
galactic-nat pins an XDP link for each Local pair's NAT end and writes rows to nat_local_pair, nat_local_return and nat_vlan_egress. Only the running Worker integration removed them. A start with worker_socket empty or the datapath disabled left them in place, and the pairs kept translating until Worker withdrew the claims at lease expiry. That start now prunes with an empty keep set. With the datapath loaded, it uses the loaded maps. With the datapath disabled, it opens the pinned maps and treats a missing pin as empty, so a node that never ran galactic-nat stays untouched. A failure is logged, like turnOffDatapath's, and startup continues. Prune with an empty keep set now also clears nat_vlan_egress. Its only writer is kernelLocal.syncVLANs, and nat.c only reads it. Prune also treats a missing links directory as empty. The lab case now checks that galactic-nat removed its pins and rows on its own after restarting without the socket, and drops the manual rm and bpftool deletes. Fixes #1479
|
Clearing all of
Nothing else in Go or eBPF references the map, apart from the two lab scripts. |
Merging integration added a third use of the pair names in workerlocal_test.go, which goconst flags.
|
Lab evidence for 1026f38 on the shared containerlab, deployed from integration dc79653. Only
The teardown restarts No manual removal of CI: the first attempt of Unit Tests (root) on 0a8ad13 failed |
The startup cleanup sentence left one line at 95 characters.
|
Review record:
The base branch has no review rule, so auto-merge completed on green CI. |
fix(nat): remove Local pair state when Worker integration is off
fix(nat): remove Local pair state when Worker integration is off
fix(nat): remove Local pair state when Worker integration is off
Summary
Restarting the NAT shard with its Worker integration or its datapath off left every local pair attached and translating until Worker's claims expired, about 2 minutes later.
That restart now detaches the pairs and empties their tables at once. A node that never ran the shard is left untouched. The lab case checks this and drops its manual cleanup.
Test plan
Fixes #1479