Merge ~zhhuabj/ubuntu/+source/neutron:yoga into ~ubuntu-openstack-dev/ubuntu/+source/neutron:stable/yoga

Proposed by Hua Zhang
Status: Needs review
Proposed branch: ~zhhuabj/ubuntu/+source/neutron:yoga
Merge into: ~ubuntu-openstack-dev/ubuntu/+source/neutron:stable/yoga
Diff against target: 86 lines (+74/-0)
2 files modified
debian/patches/handle-creation-of-Port_Binding-with-chassis-set.patch (+73/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Ubuntu OpenStack uploaders Pending
Review via email: mp+475881@code.launchpad.net
To post a comment you must log in.

Unmerged commits

c99d388... by Hua Zhang

d/p/handle-creation-of-Port_Binding-with-chassis-set.patch (LP: #2017748)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/patches/handle-creation-of-Port_Binding-with-chassis-set.patch b/debian/patches/handle-creation-of-Port_Binding-with-chassis-set.patch
2new file mode 100644
3index 0000000..c6d6dc6
4--- /dev/null
5+++ b/debian/patches/handle-creation-of-Port_Binding-with-chassis-set.patch
6@@ -0,0 +1,73 @@
7+From 952e960414e7c15d4d4351bf2300ce53a69e4051 Mon Sep 17 00:00:00 2001
8+From: Terry Wilson <twilson@redhat.com>
9+Date: Tue, 20 Aug 2024 10:20:52 -0500
10+Subject: [PATCH] Handle creation of Port_Binding with chassis set
11+
12+When there is a backlog of notifications to be sent, it is possible
13+that ovsdb-server will merge insert and update notifications. Due
14+to this, we need to handle the situation where we see a Port_Binding
15+created with the chassis set.
16+
17+Closes-Bug: #2017748
18+Change-Id: Idfae87cf6c60e9e18ede91ea20857cea5322738c
19+---
20+ neutron/agent/ovn/metadata/agent.py | 16 +++++++++-------
21+ 1 file changed, 9 insertions(+), 7 deletions(-)
22+
23+diff --git a/neutron/agent/ovn/metadata/agent.py b/neutron/agent/ovn/metadata/agent.py
24+index 54a8e54056..4bc8864773 100644
25+--- a/neutron/agent/ovn/metadata/agent.py
26++++ b/neutron/agent/ovn/metadata/agent.py
27+@@ -106,14 +106,14 @@ class PortBindingChassisCreatedEvent(PortBindingChassisEvent):
28+ LOG_MSG = "Port %s in datapath %s bound to our chassis"
29+
30+ def __init__(self, metadata_agent):
31+- events = (self.ROW_UPDATE,)
32++ events = (self.ROW_CREATE, self.ROW_UPDATE,)
33+ super(PortBindingChassisCreatedEvent, self).__init__(
34+ metadata_agent, events)
35+
36+ def match_fn(self, event, row, old):
37+ try:
38+ return (row.chassis[0].name == self.agent.chassis and
39+- not old.chassis)
40++ (event == self.ROW_CREATE or not old.chassis))
41+ except (IndexError, AttributeError):
42+ return False
43+
44+@@ -297,8 +297,9 @@ class MetadataAgent(object):
45+ self.conf, self.chassis, sb_idl=self.sb_idl)
46+ self._proxy.run()
47+
48+- # Do the initial sync.
49+- self.sync()
50++ # Do the initial sync. Provisioning handled by
51++ # PortBindingChassisCreatedEvent on initial db dump
52++ self.sync(provision=False)
53+
54+ # Register the agent with its corresponding Chassis
55+ self.register_metadata_agent()
56+@@ -349,7 +350,7 @@ class MetadataAgent(object):
57+ return set(p.datapath for p in self._vif_ports(ports))
58+
59+ @_sync_lock
60+- def sync(self):
61++ def sync(self, provision=True):
62+ """Agent sync.
63+
64+ This function will make sure that all networks with ports in our
65+@@ -379,8 +380,9 @@ class MetadataAgent(object):
66+ # resync all network namespaces based on the associated datapaths,
67+ # even those that are already running. This is to make sure
68+ # everything within each namespace is up to date.
69+- for datapath in net_datapaths:
70+- self.provision_datapath(datapath)
71++ if provision:
72++ for datapath in net_datapaths:
73++ self.provision_datapath(datapath)
74+
75+ @staticmethod
76+ def _get_veth_name(datapath):
77+--
78+2.43.0
79+
80diff --git a/debian/patches/series b/debian/patches/series
81index 71779ba..ff5ca6c 100644
82--- a/debian/patches/series
83+++ b/debian/patches/series
84@@ -1 +1,2 @@
85 skip-iptest.patch
86+handle-creation-of-Port_Binding-with-chassis-set.patch

Subscribers

People subscribed via source and target branches