DB deadlock when delete subnet
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Triaged
|
Undecided
|
Unassigned |
Bug Description
my env is stable/queens
when delete a network/
the code here: https:/
the DB operate is just like:
DELETE FROM subnets WHERE subnets.id = '5d9bb112-
DELETE FROM ipamsubnets WHERE ipamsubnets.id = '9674ebea-
and if there is a alloc ip action in this time,the code below:
https:/
the DB operate is just like:
INSERT INTO ipamallocations (ip_address, status, ipam_subnet_id) VALUES ('192.168.1.3', 'ALLOCATED', '9674ebea-
INSERT INTO ipallocations (port_id, ip_address, ip_address_integer, subnet_id, network_id) VALUES ('6a704ca2-
the table ipamallocations has Foreign Key ipamsubnetid
the table ipallocations has Foreign Key subnetid
so,step 4 wait 1 to release shared lock, step 3 wait 2 to release shared lock, deadlock.
how to solve this issue?
I switch the order ,delete ipamsubnet first, delete subnet later.it seems to solve the issue.
but there's another deadlock between standardattributes and ml2_port_bindings when delete network.