|
| 1 | +--- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py |
| 2 | ++++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py |
| 3 | +@@ -362,7 +362,11 @@ |
| 4 | + def match_fn(self, event, row, old=None): |
| 5 | + # On updates to Chassis_Private because the Chassis has been deleted, |
| 6 | + # don't update the AgentCache. We use chassis_private.chassis to return |
| 7 | +- # data about the agent. |
| 8 | ++ # data about the agent. Require a valid chassis reference for all |
| 9 | ++ # events including ROW_CREATE: an orphaned Chassis_Private (where the |
| 10 | ++ # Chassis row was already deleted) must not create a ghost agent entry. |
| 11 | ++ if not row.chassis: |
| 12 | ++ return False |
| 13 | + return (event == self.ROW_CREATE or |
| 14 | + (hasattr(old, 'nb_cfg') and row.chassis)) |
| 15 | + |
| 16 | +@@ -428,14 +432,13 @@ |
| 17 | + if not self.agent_id(row): |
| 18 | + # Don't create a cached object with an agent_id of 'None' |
| 19 | + return False |
| 20 | +- if event == self.ROW_CREATE: |
| 21 | +- return True |
| 22 | +- |
| 23 | +- # On updates to Chassis_Private because the Chassis has been |
| 24 | +- # deleted, don't update the AgentCache. We use |
| 25 | +- # chassis_private.chassis to return data about the agent. |
| 26 | ++ # Require a valid chassis reference for all events including |
| 27 | ++ # ROW_CREATE: an orphaned Chassis_Private (where the Chassis row |
| 28 | ++ # was already deleted) must not create a ghost agent entry. |
| 29 | + if not getattr(row, 'chassis', None): |
| 30 | + return False |
| 31 | ++ if event == self.ROW_CREATE: |
| 32 | ++ return True |
| 33 | + |
| 34 | + # Check if both rows have external_ids before comparing nb_cfg |
| 35 | + if not (hasattr(old, 'external_ids') and row.external_ids): |
0 commit comments