Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
northd: Clean up SB MAC bindings for deleted ports.
Static_MAC_Binding (SMB) records are only deleted from the southbound-db via ovn-northd when there is no such SMB found in the northbound-db. This leads to problems when a port becomes stale (ex. through lr deletion), because the Logical_Router and Logical_Router_Port records are removed from the nb-db, but not the Static_MAC_Binding record. So, when ovn-northd attempts to remove the corresponding Datapath_Binding and Port_Binding records from sb-db, it fails because of a referential integrity violation: the Static_MAC_Binding record contains a reference to Datapath_Binding. The corrected behavior is that SMB's are now deleted: 1. when there's no such SMB in the nb-db, and 2. when there is no port in the nb-db with the SMB's associated port name. Thus, all three records, Datapath_Binding, Port_Binding, and Static_MAC_Binding, are removed within the same transaction. Also added a unit test to verify correct behavior. Fixes: b22684d ("Add a northbound interface to program MAC_Binding table") Reported-at: https://issues.redhat.com/browse/FDP-723 Signed-off-by: Rosemarie O'Riorden <roriorden@redhat.com> Acked-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Dumitru Ceara <dceara@redhat.com> (cherry picked from commit 417f141)
- Loading branch information