From b3e52b6b2462cf80dbdb5fa4785e51b0d147316e Mon Sep 17 00:00:00 2001 From: Eugene Nikanorov Date: Thu, 8 May 2014 15:19:02 +0400 Subject: [PATCH] ML2 VxlanTypeDriver: Synchronize of VxlanAllocation table At neutron startup VxlanTypeDriver syncs tunnel range from conf to DB. In case multiple servers deployment restarting several servers at the same time could lead to DB exceptions being thrown. Need to synchronize between neutron servers by locking VxlanAllocation table. Change-Id: Idf9908f039070b9194612484603f592f1a8d74b8 Closes-Bug: #1307295 --- neutron/plugins/ml2/drivers/type_vxlan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/plugins/ml2/drivers/type_vxlan.py b/neutron/plugins/ml2/drivers/type_vxlan.py index 959300d30..0764be310 100644 --- a/neutron/plugins/ml2/drivers/type_vxlan.py +++ b/neutron/plugins/ml2/drivers/type_vxlan.py @@ -153,7 +153,7 @@ class VxlanTypeDriver(type_tunnel.TunnelTypeDriver): session = db_api.get_session() with session.begin(subtransactions=True): # remove from table unallocated tunnels not currently allocatable - allocs = session.query(VxlanAllocation) + allocs = session.query(VxlanAllocation).with_lockmode("update") for alloc in allocs: try: # see if tunnel is allocatable -- 2.45.2