Repository navigation
fix(cni): Treat a shard reached only by default route as down - #1372
Merged
Merged
Conversation
|
|
When an egress shard's node dies, its SID route is withdrawn, but a compute node whose only other route is an upstream default over an SRv6 uplink still resolves the SID through that default. The shard keeps counting as alive, tenants stay pinned to it, their egress is lost for the whole outage, and a NAT64 standby is never promoted. Look up the FIB entry the SID matches and reject a default route, so a withdrawn SID makes its shard unreachable on every node. Kernels that cannot answer a FIB-match lookup keep the previous behaviour.
scotwells
force-pushed
the
claude/project-thread-pmmhz6
branch
from
November 6, 2026 19:08
27677f3 to
7e33d4c
Compare
ecv
approved these changes
Nov 6, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
A SID that only matches a default route is now treated as unreachable, which matches how the fabric advertises shards and makes failover actually trigger. The check is narrow and fails open when the kernel cannot answer.
rejectDefaultRouteusesRouteGetWithOptions(FIBMatch: true)in the same netns and table as the existingRouteGet, so it adds no new table or VRF assumption. A nilDstor a/0mask counts as default. A/1-style split default is not caught; acceptable.- A FIBMatch error or empty answer returns nil, so an old kernel keeps the previous behaviour instead of failing every SID. Good.
- The local shard is unaffected: its SID resolves out a non-uplink link and was already rejected before this check, and
heldalready exemptsc.local. - nat64Standby: a primary that only default-routes now has
hop.err != nil, soanyPrimaryAlivegoes false and the standby is released. That is the intended failover, and it flaps only as fast as the route does, since groups rebuild on route change plus the 30s backstop. - The test covers default-only vs specific route over an uplink. It does not cover the case where every remote shard falls through to default (group_empty).
Follow-ups:
- The premise "the fabric advertises every SID as a specific route" is a deployment assumption. A lab or site that reaches peer shards only through a static default over an uplink will now mark every remote shard down and leave the class with zero active shards, dropping tenant NAT. Confirm the staging labs advertise per-locator routes before this ships to them, and consider a log line or metric when a candidate is rejected for default-only.
- Add a
shardgrouptest with all candidates default-only that pins the group_empty outcome and the standby release.
Contributor
Author
|
Thanks for the review. Here's where the follow-ups stand:
Generated by Claude Code |
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Scot Schuchert-Wells · project thread
Summary
When an egress shard's node goes down, compute nodes keep sending tenant egress to it for the whole outage, so tenants lose internet access and a NAT64 standby is never promoted. The shard's SID route is withdrawn, but a compute node whose only other route is an upstream default over an SRv6 uplink still resolves the SID through that default and keeps counting the shard as alive. The reachability check now asks the kernel which FIB entry the SID matches and treats a default-route match as unreachable, so a withdrawn SID takes its shard out of every group on every node and the pool metrics and alerts see it. Kernels that cannot answer a FIB-match lookup keep the previous behaviour.
Related to datum-cloud/infra#7781
Test plan
Generated by Claude Code