Fix DBDuplicateEntry in HA configurations
With multiple neutron-server processes and controllers, there is a race-condition for creation of certain resources on startup. This patch adds the retry decorator, which will retry DBDuplicateEntry exceptions, and ignore creation if the resource has been created already. Change-Id: I58d2737e585cee13ae1a5f37ec6e567ccc06339f
This commit is contained in:
parent
2210d27f48
commit
e19764972e
|
@ -292,6 +292,7 @@ class ApicMechanismDriver(api_plus.MechanismDriver,
|
|||
raise exceptions.ExhaustedApicRouterIdPool(
|
||||
pool=self.apic_router_id_pool)
|
||||
|
||||
@db_api.retry_db_errors
|
||||
def _ensure_static_resources(self):
|
||||
session = db_api.get_writer_session()
|
||||
aim_ctx = aim_context.AimContext(session)
|
||||
|
|
Loading…
Reference in New Issue