Merge "Retry with stale DB values"

This commit is contained in:
Zuul 2017-11-16 17:53:35 +00:00 committed by Gerrit Code Review
commit 60c44020eb
3 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import netaddr
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import excutils from oslo_utils import excutils
from neutron.db import api as db_api
from neutron.db import l3_db from neutron.db import l3_db
from neutron_lib import constants from neutron_lib import constants
@ -135,6 +136,7 @@ class RouterDistributedDriver(router_driver.RouterBaseDriver):
self._update_routes_on_plr(context, router_id, plr_id, self._update_routes_on_plr(context, router_id, plr_id,
newnexthop) newnexthop)
@db_api.retry_db_errors
def _update_router_gw_info(self, context, router_id, info, def _update_router_gw_info(self, context, router_id, info,
is_routes_update=False, is_routes_update=False,
force_update=False): force_update=False):

View File

@ -14,6 +14,7 @@
from oslo_log import log as logging from oslo_log import log as logging
from neutron.db import api as db_api
from neutron_lib import constants as n_consts from neutron_lib import constants as n_consts
from neutron_lib.plugins import constants as plugin_const from neutron_lib.plugins import constants as plugin_const
@ -152,6 +153,7 @@ class RouterExclusiveDriver(router_driver.RouterBaseDriver):
self._get_router_edge_id(context, router_id)): self._get_router_edge_id(context, router_id)):
self.plugin._update_routes(context, router_id, nexthop) self.plugin._update_routes(context, router_id, nexthop)
@db_api.retry_db_errors
def _update_router_gw_info(self, context, router_id, info, def _update_router_gw_info(self, context, router_id, info,
is_routes_update=False, force_update=False): is_routes_update=False, force_update=False):
router = self.plugin._get_router(context, router_id) router = self.plugin._get_router(context, router_id)

View File

@ -15,6 +15,7 @@
import netaddr import netaddr
from oslo_config import cfg from oslo_config import cfg
from neutron.db import api as db_api
from neutron.db import l3_db from neutron.db import l3_db
from neutron.db.models import l3 as l3_db_models from neutron.db.models import l3 as l3_db_models
from neutron.db import models_v2 from neutron.db import models_v2
@ -679,6 +680,7 @@ class RouterSharedDriver(router_driver.RouterBaseDriver):
for net_id in intf_net_ids: for net_id in intf_net_ids:
edge_utils.delete_interface(self.nsx_v, context, router_id, net_id) edge_utils.delete_interface(self.nsx_v, context, router_id, net_id)
@db_api.retry_db_errors
def _update_router_gw_info(self, context, router_id, info, def _update_router_gw_info(self, context, router_id, info,
is_routes_update=False, is_routes_update=False,
force_update=False): force_update=False):