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
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
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()