A LAG no longer hashes traffic onto a member whose link is down (#1263) #1264
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1264
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/lag-member-link-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A LAG no longer hashes traffic onto a member whose link is down
Fixes #1263.
The bug
Two switches joined by a two-member port-channel. Both cables in: pings cross. One cable out: every ping
fails.
selectMember()filtered onenabledand nothing else, and the forwarding path's candidate list filteredspanning tree and VLAN membership and nothing else — so the hash kept landing on the unplugged member while
Fa0/2, up and idle, carried nothing. Andshow etherchannel summarycalled both members(P), i.e. "thisport is carrying traffic", for a port whose link was down.
A bundle exists to survive losing a member. Here, losing one cost whatever hashed to it, and the only clue
was a drop count on a port that still looked bundled.
Now
selectMember(members, frame, policy, { canCarry })takes an operational predicate — a predicaterather than a flag, so
engine/lag.jsstays free of topology while every caller still has to answer thesame question;
Device.ifaceStatus(iface, topo)— the one ruleshow interfaces,show arpand the canvas already use — so a pulled cable, a down link, a shut far port, anadministratively-down port and an STP-blocked port are excluded the same way, in the same words;
eligibleMembers()is exported so the CLI and the data plane cannot hold two opinions about a bundle;byte-for-byte what it was, so flows do not re-balance on an unrelated change;
loss stays countable (#1258) rather than vanishing into a bundle that looks healthy;
show etherchannel summarymarks(P)only for members that can carry,(D)otherwise, prints why in thesame sentence
show interfacesuses, and reports the bundle's live member count or that it is down;lagtimeline event recordslive,degradedandnoLiveMember, so a viewer does not have to difftwo arrays to see why a member was skipped.
Evidence
test/lag-member-down.test.js— 30 checks:(P), nothing called out) — the fix must not re-balanceworking flows;
(administratively down); a shut far port readspeer shut down— the samefault seen from the other end says a different thing, correctly;
nullwhen nothing can carry,enabledstill honoured,eligibleMembersdedupes and sorts;lagevent recordsmembers,live,degraded,noLiveMember.Reverting
engine/simulator.jsfails 5;engine/cli.jsfails 9;engine/lag.jsfails the suite outright.docs/CLI.mdgains "Readingshow etherchannel summary" and the command in the table.Suite: 145 suites, 6,194 assertions, 0 failed.
Two switches joined by a two-member port-channel: with both cables in, pings cross; take one cable out and every ping fails, because the hash kept landing on the unplugged member while the surviving member sat idle. both links up true,true,true,true one member down false,false,false,false,false,false picks: Fa0/3 every time `selectMember()` filtered on `enabled` and nothing else, and the forwarding path's candidate list filtered spanning tree and VLAN membership and nothing else. `show etherchannel summary` reported both members (P) throughout - "this port is carrying traffic" - for a port whose link was down. Now: * `selectMember(members, frame, policy, { canCarry })` takes an operational predicate. It is a predicate rather than a flag so engine/lag.js stays free of topology while every caller still has to answer the same question; * the simulator answers it with `Device.ifaceStatus(iface, topo)` - the one rule `show interfaces`, `show arp` and the canvas already use - so a pulled cable, a down link, a shut far port, an administratively down port and an STP-blocked port are all excluded the same way; * `eligibleMembers()` is exported so the CLI and the data plane cannot hold two opinions about a bundle; * the hash is taken over eligible members only, so the bundle keeps working; with nothing wrong the pick is byte-for-byte what it was, so flows do not re-balance on an unrelated change; * when no member can carry, one is still picked so the frame is attempted and dropped with a reason - the loss stays countable (#1258) instead of vanishing into a bundle that looks healthy; * `show etherchannel summary` marks (P) only for members that can carry, (D) otherwise, prints why in the same sentence show interfaces uses (`not bundled (down: link down)`, `(administratively down)`, `(STP blocking)`), and reports `bundle 1 is running on 1 of 2 members: Fa0/2` or `bundle 1 is down: no member can carry a frame`; * the lag timeline event records `live`, `degraded` and `noLiveMember`, so a viewer does not have to diff two arrays to see why a member was skipped. test/lag-member-down.test.js (30 checks): a healthy bundle is unchanged and both members read (P); with one cable down every ping is still answered and no frame is hashed onto the dead member; a shut member and a shut far port are named differently; with no live member the bundle is reported down and the drops are counted with a reason; the pick does not depend on config order, returns null when nothing can carry, honours `enabled`, and `eligibleMembers` dedupes and sorts; and the lag event records what could carry. Reverting engine/simulator.js fails 5, engine/cli.js fails 9, engine/lag.js fails the suite outright. Suite: 145 suites, 6,194 assertions, 0 failed.