Merge "Fix neutron_pg_drop-related startup issues" into stable/ussuri

This commit is contained in:
Zuul 2021-09-16 12:26:48 +00:00 committed by Gerrit Code Review
commit fad9a8e235
2 changed files with 14 additions and 3 deletions

View File

@ -240,6 +240,15 @@ class OVNMechanismDriver(api.MechanismDriver):
impl_idl_ovn.OvsdbNbOvnIdl, idl) as pre_ovn_nb_api:
try:
create_default_drop_port_group(pre_ovn_nb_api)
except KeyError:
# Due to a bug in python-ovs, we can send transactions before
# the initial OVSDB is populated in memory. This can break
# the AddCommand post_commit method which tries to return a
# row looked up by the newly commited row's uuid. Since we
# don't care about the return value from the PgAddCommand, we
# can just catch the KeyError and continue. This can be
# removed when the python-ovs bug is resolved.
pass
except RuntimeError as re:
if pre_ovn_nb_api.get_port_group(
ovn_const.OVN_DROP_PORT_GROUP_NAME):

View File

@ -572,9 +572,11 @@ class OvnInitPGNbIdl(OvnIdl):
def __init__(self, driver, remote, schema):
super(OvnInitPGNbIdl, self).__init__(driver, remote, schema)
self.cond_change(
'Port_Group',
[['name', '==', ovn_const.OVN_DROP_PORT_GROUP_NAME]])
# self.cond_change() doesn't work here because we are setting the
# condition *before an initial monitor request is made* so there is
# no previous session whose condition we wish to change
self.tables['Port_Group'].condition = [
['name', '==', ovn_const.OVN_DROP_PORT_GROUP_NAME]]
self.neutron_pg_drop_event = NeutronPgDropPortGroupCreated()
self.notify_handler.watch_event(self.neutron_pg_drop_event)