diff --git a/neutron/db/l3_db.py b/neutron/db/l3_db.py index 4e3eff0ad48..6beeee0e664 100644 --- a/neutron/db/l3_db.py +++ b/neutron/db/l3_db.py @@ -1551,7 +1551,6 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase, context, id, floatingip) return floatingip - @db_api.retry_if_session_inactive() def update_floatingip_status(self, context, floatingip_id, status): """Update operational status for floating IP in neutron DB.""" return l3_obj.FloatingIP.update_object( diff --git a/neutron/services/ovn_l3/plugin.py b/neutron/services/ovn_l3/plugin.py index 60766fd25dd..a2897fe79c4 100644 --- a/neutron/services/ovn_l3/plugin.py +++ b/neutron/services/ovn_l3/plugin.py @@ -22,6 +22,7 @@ from neutron_lib.callbacks import registry from neutron_lib.callbacks import resources from neutron_lib import constants as n_const from neutron_lib import context as n_context +from neutron_lib.db import api as db_api from neutron_lib import exceptions as n_exc from neutron_lib.exceptions import availability_zone as az_exc from neutron_lib.plugins import constants as plugin_constants @@ -288,11 +289,17 @@ class OVNL3RouterPlugin(service_base.ServicePluginBase, return fip def update_floatingip_status(self, context, floatingip_id, status): - fip = super(OVNL3RouterPlugin, self).update_floatingip_status( + fip = self.update_floatingip_status_retry( context, floatingip_id, status) self._ovn_client.update_floatingip_status(context, fip) return fip + @db_api.retry_if_session_inactive() + def update_floatingip_status_retry(self, context, floatingip_id, status): + with db_api.CONTEXT_WRITER.using(context): + return super(OVNL3RouterPlugin, self).update_floatingip_status( + context, floatingip_id, status) + def disassociate_floatingips(self, context, port_id, do_notify=True): fips = self.get_floatingips(context.elevated(), filters={'port_id': [port_id]})