fix(srv6): implement DelConnectivity with NLRI-key teardown and candidate-path failover#1025
fix(srv6): implement DelConnectivity with NLRI-key teardown and candidate-path failover#1025ryskn wants to merge 2 commits into
Conversation
…date-path failover SRv6Provider.DelConnectivity was a FIXME no-op. Implement SR Policy withdraw/teardown and the candidate-path failover that follows it (RFC 9012 NLRI key, RFC 9256 candidate paths): - A withdraw is handled per NLRI key <Distinguisher, Color, Endpoint>, so it tears down only the candidate path it identifies and never collaterally removes other policies on the same endpoint. - After teardown the orphaned prefix is re-steered onto the next-best surviving candidate of the same behavior on the same endpoint; the survivor is installed on demand (it was masked by the higher-priority winner and never reached CreateSRv6Tunnel). - The SR Policy NLRI cache is keyed by the NLRI key and upserted in place; on a BSID change the prior BSID is torn down after the steering has been re-pointed, and a pendingBsidCleanup queue retries cleanups that VPP still resolves through so a superseded BSID never leaks. - NO_SUCH_INNER_FIB and UNSPECIFIED from VPP are treated as idempotent "already gone" in a delete context (debug, not warn); other errors warn. - getPolicyNode skips candidates with a nil SrPolicy (nil-deref guard) and uses a strict priority comparison so a tie deterministically keeps the first candidate. common.SRv6Tunnel carries Color and Distinguisher; getSRPolicy populates them on success, on the withdraw short-circuit, and on the mixed-behavior reject so the SRv6PolicyDeleted dispatch is NLRI-key targeted. Signed-off-by: Ryosuke Nakayama <ryosuke.nakayama@ryskn.com>
547dfb5 to
1f464dd
Compare
|
/codebuild_run(1f464dd) |
|
Because Given the |
|
One fix was required for that to be correct: the node-IP /128 steering lives in Unit tests (fake VPP, no dataplane):
Verified on a Linux node (fake-VPP unit tests, no real dataplane): the teardown/failover tests and the existing failover/NLRI tests are green. IPv4 node IPs / End.DT4 remain out of scope ( |
resteerOrphan rebuilt the steering without a FibTable, so a candidate-path failover re-pointed every orphaned prefix into the main table. Pod-prefix steerings live there so they were unaffected, but the node-IP /128 steering (steerNodeIPViaSID, for host-network-backed ClusterIPs) lives in PodVRFIndex and would have been silently moved to table 0 on failover, breaking the host plane. Carry the full SrSteer (including FibTable) in the orphan set and preserve it on re-steer, so pod-prefix (main table) and node-IP /128 (PodVRFIndex) steerings each fail over into their original table. The same delSRPolicy BSID match also tears the node-IP /128 steering down when no candidate survives. Tests: TestDelSRPolicy_FailoverPreservesNodeIPSteeringFibTable, TestDelSRPolicy_TearsDownNodeIPSteeringWhenNoSurvivor. Signed-off-by: Ryosuke Nakayama <ryosuke.nakayama@ryskn.com>
0a36f50 to
f0f66ad
Compare
|
/codebuild_run(f0f66ad) |
Description
SRv6Provider.DelConnectivitywas a FIXME no-op. This implements SR Policy withdraw/teardown and the candidate-path failover that follows it (RFC 9012 NLRI key, RFC 9256 candidate paths).<Distinguisher, Color, Endpoint>, tearing down only the candidate path it identifies — never collaterally removing other policies on the same endpoint.pendingBsidCleanupqueue retries cleanups VPP still resolves through so a superseded BSID never leaks.NO_SUCH_INNER_FIB/UNSPECIFIEDfrom VPP are treated as idempotent "already gone" on delete (debug, not warn).common.SRv6Tunnelnow carries Color and Distinguisher;getSRPolicypopulates them so theSRv6PolicyDeleteddispatch is NLRI-key targeted.How Has This Been Tested?
Unit tests for the teardown / failover / cache paths are included (
connectivity/srv6_test.go, fake VPP, no dataplane needed): NLRI-key precision, candidate-path failover (orphan collection + on-demand install + re-steer with dedupe), idempotent delete, BSID-change cleanup ordering, the re-point-failed guard, and the pending-cleanup retry.Also verified end-to-end on a 3-node IPv6 single-stack cluster with an external gobgpd controller. From a worker, a remote-node pod prefix (
fd20::b91:ca7f:1e60:6840/122) is steered; SR Policy A is installed then withdrawn.Prior behavior — a withdraw double-deletes and re-steers twice:
With this change — clean withdraw, single failover, no warn/error:
BSID change (re-advertise the same NLRI key with a new BSID) — the prior BSID is removed from VPP and the steering re-points: