Skip to content

Commit a1520bc

Browse files
fix(neutron): Fix for neutron+ovn chassis register deleted issue
1 parent 60d61ad commit a1520bc

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

containers/neutron/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ ARG OPENSTACK_VERSION="required_argument"
2121
ADD https://releases.openstack.org/constraints/upper/${OPENSTACK_VERSION} /upper-constraints.txt
2222
RUN sed -i '/^neutron-lib==.*/d' /upper-constraints.txt
2323

24+
COPY containers/neutron/patches /tmp/patches/
25+
RUN cd /src/neutron && git apply /tmp/patches/*.patch
26+
2427
RUN --mount=type=cache,target=/root/.cache/uv \
2528
uv pip install \
2629
--upgrade \
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

Comments
 (0)