Galera multi-writers compliant sync_allocations

Currently sync_allocations[1] uses with_lockmode('update) which implies
possible deadlocks with Galera multi-writers. This change decorates the
method in order to catch and retry sync_allocations.

[1] neutron.plugins.ml2.drivers.type_tunnel

Change-Id: Ic01614cb5daf174848cf14a6aa4b38c4ed40fe1e
This commit is contained in:
Cedric Brandily 2015-06-16 09:42:35 +02:00
parent 9d84a424f2
commit d0820e716f
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import itertools
import operator
from oslo_config import cfg
from oslo_db import api as oslo_db_api
from oslo_db import exception as db_exc
from oslo_log import log
from six import moves
@ -122,6 +123,8 @@ class TunnelTypeDriver(helpers.SegmentTypeDriver):
LOG.info(_LI("%(type)s ID ranges: %(range)s"),
{'type': self.get_type(), 'range': current_range})
@oslo_db_api.wrap_db_retry(
max_retries=db_api.MAX_RETRIES, retry_on_deadlock=True)
def sync_allocations(self):
# determine current configured allocatable tunnel ids
tunnel_ids = set()