Skip to content

Commit b271d95

Browse files
committed
Skip LSP host info update for trunk subports
In ML2/OVN, the subports bindings are not updated with the host information. This patch skips the LSP update in that case. Currently the method ``update_lsp_host_info`` is stuck executing ``_wait_for_port_bindings_host``. During this time the subport can be deleted or removed from the trunk. That will clash with the newer operation that tries to remove the LSP port host info and is the cause of the related bug. Closes-Bug: #2085462 Change-Id: Ic68f9b5aa3b06bc4e1cbfbe577efc33b4b617b45 (cherry picked from commit 63d14a3)
1 parent a75051c commit b271d95

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from neutron_lib.plugins import utils as p_utils
3333
from neutron_lib.services.logapi import constants as log_const
3434
from neutron_lib.services.qos import constants as qos_consts
35+
from neutron_lib.services.trunk import constants as trunk_const
3536
from neutron_lib.utils import helpers
3637
from neutron_lib.utils import net as n_net
3738
from oslo_config import cfg
@@ -289,6 +290,10 @@ def update_lsp_host_info(self, context, db_port, up=True):
289290
Defaults to True.
290291
"""
291292
cmd = []
293+
if db_port.device_owner == trunk_const.TRUNK_SUBPORT_OWNER:
294+
# NOTE(ralonsoh): OVN subports don't have host ID information.
295+
return
296+
292297
if up:
293298
if not db_port.port_bindings:
294299
return

neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from neutron_lib.api.definitions import l3
2727
from neutron_lib import constants as const
2828
from neutron_lib.services.logapi import constants as log_const
29+
from neutron_lib.services.trunk import constants as trunk_const
2930

3031
from tenacity import wait_none
3132

@@ -170,6 +171,15 @@ def test_update_lsp_host_info_down(self):
170171
'Logical_Switch_Port', port_id, 'external_ids',
171172
constants.OVN_HOST_ID_EXT_ID_KEY, if_exists=True)
172173

174+
def test_update_lsp_host_info_trunk_subport(self):
175+
context = mock.MagicMock()
176+
db_port = mock.Mock(id='fake-port-id',
177+
device_owner=trunk_const.TRUNK_SUBPORT_OWNER)
178+
179+
self.ovn_client.update_lsp_host_info(context, db_port)
180+
self.nb_idl.db_remove.assert_not_called()
181+
self.nb_idl.db_set.assert_not_called()
182+
173183
@mock.patch.object(ml2_db, 'get_port')
174184
def test__wait_for_port_bindings_host(self, mock_get_port):
175185
context = mock.MagicMock()

0 commit comments

Comments
 (0)