You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
northd: Mark BFD sessions down when no chassis can run them.
The Southbound BFD "status" column is only ever written by the
ovn-controller that runs the session: bfd_monitor_run() picks a session
up on the chassis where the port is a bound "l3gateway" port or where
the port's "cr-" chassisredirect twin is chassis-resident. When that
chassis goes away and no other chassis can take the gateway port over
(e.g. it was the only chassis with a bridge mapping for the provider
network), nothing is left to update the session status: the NB/SB
status stays "up" forever even though no BFD packets are exchanged any
more. BFD monitored (ECMP) static routes then keep selecting the dead
next hop and traffic is blackholed.
Fix this in ovn-northd, which can see that no chassis owns the port:
teach bfd_table_sync() to determine the chassis that would run the
session, mirroring the ownership rule of bfd_monitor_run(), and force
both the NB and SB status to "down" when there is no such chassis,
leaving "admin_down" sessions untouched. Route (and policy) processing
already drops BFD monitored next hops whose session is "down", so this
is enough to withdraw the routes. Once a chassis (re)claims the
gateway port, its ovn-controller creates a fresh monitor entry and
kicks the session back into negotiation, so a northd-written "down"
does not prevent recovery.
Use the same ownership rule to maintain the SB BFD "chassis_name"
column. It was previously derived from the port's own Port_Binding
only, but for a distributed gateway port that binding is a "patch"
port whose chassis column is never set, so chassis_name stayed empty
even for healthy sessions. It now tracks the chassis bound to the
chassisredirect port and is cleared when the session has no owner.
Finally, make the incremental processing engine reevaluate the session
ownership when the Port_Binding of a port with a BFD session changes
its bound chassis: the "northd" engine node deliberately ignores
chassis-only binding updates, so a gateway port being released would
not have re-triggered bfd_table_sync(). Add SB Port_Binding as an
input of the "bfd_sync" engine node, with a change handler that falls
back to recompute when the "chassis" column changed on the Port_Binding
of a port (or of a chassisredirect twin of a port) that has a BFD
session, and ignores all other Port_Binding changes.
Reported-at: #320
Assisted-by: Claude Code
Signed-off-by: Premysl Kouril <premysl.kouril@gmail.com>
0 commit comments