Public bug reported:

my env is stable/queens

when delete a network/sunbet,neutron delete subnet first and then delete 
ipamsubnet.
the code here: 
https://github.com/openstack/neutron/blob/stable/queens/neutron/db/db_base_plugin_v2.py#L1029

the DB operate is just like:
DELETE FROM subnets WHERE subnets.id = '5d9bb112-622a-4b56-b5b9-f6c0fa6dbe7b';  
   step 1
DELETE FROM ipamsubnets WHERE ipamsubnets.id = 
'9674ebea-992a-4d78-b234-a3f6f640ad8a';   step 3 wait 2

and if there is a alloc ip action in this time,the code below:
https://github.com/openstack/neutron/blob/stable/queens/neutron/db/ipam_pluggable_backend.py#L162

the DB operate is just like:
INSERT INTO ipamallocations (ip_address, status, ipam_subnet_id) VALUES 
('192.168.1.3', 'ALLOCATED', '9674ebea-992a-4d78-b234-a3f6f640ad8a');      step 
2
INSERT INTO ipallocations (port_id, ip_address, ip_address_integer, subnet_id, 
network_id) VALUES ('6a704ca2-c258-4b15-8bc2-8b434e2689d6', '192.168.1.3', 0, 
'5d9bb112-622a-4b56-b5b9-f6c0fa6dbe7b', 
'a3c0ad20-661d-4b9b-beef-10adabcacf06');   step 4 wait 1


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?

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1793516

Title:
  DB deadlock when delete subnet

Status in neutron:
  New

Bug description:
  my env is stable/queens

  when delete a network/sunbet,neutron delete subnet first and then delete 
ipamsubnet.
  the code here: 
https://github.com/openstack/neutron/blob/stable/queens/neutron/db/db_base_plugin_v2.py#L1029

  the DB operate is just like:
  DELETE FROM subnets WHERE subnets.id = 
'5d9bb112-622a-4b56-b5b9-f6c0fa6dbe7b';     step 1
  DELETE FROM ipamsubnets WHERE ipamsubnets.id = 
'9674ebea-992a-4d78-b234-a3f6f640ad8a';   step 3 wait 2

  and if there is a alloc ip action in this time,the code below:
  
https://github.com/openstack/neutron/blob/stable/queens/neutron/db/ipam_pluggable_backend.py#L162

  the DB operate is just like:
  INSERT INTO ipamallocations (ip_address, status, ipam_subnet_id) VALUES 
('192.168.1.3', 'ALLOCATED', '9674ebea-992a-4d78-b234-a3f6f640ad8a');      step 
2
  INSERT INTO ipallocations (port_id, ip_address, ip_address_integer, 
subnet_id, network_id) VALUES ('6a704ca2-c258-4b15-8bc2-8b434e2689d6', 
'192.168.1.3', 0, '5d9bb112-622a-4b56-b5b9-f6c0fa6dbe7b', 
'a3c0ad20-661d-4b9b-beef-10adabcacf06');   step 4 wait 1

  
  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?

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1793516/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to