DVR: race in dvr serviceable port deletion

Bug #1538163 reported by Oleg Bondarev on 2016-01-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Undecided
Oleg Bondarev

Bug Description

In ml2 plugin when dvr seviceable port is deleted, we check if any dvr routers should be deleted from port's host.
This is done prior to actual port deletion from db by checking if there are any more dvr serviceable ports on this host.
This is prone to races: if two last compute ports on the host are deleted concurrently, the check might not return any routers as in both cases it will see yet another dvr serviceable port on the host:

- p1 and p2 are last compute ports on compute host 'host1'
- p1 and p2 are on the same subnet connected to a dvr router 'r1'
- p1 and p2 are deleted concurrently
- on p1 deletion plugin checks if there are any more dvr serviceable ports on host1 - sees p2 -> no dvr routers should be deleted
- same on p2 deletion plugin checks if there are any more dvr serviceable ports on host1 - sees p1 -> no dvr routers should be deleted
- p1 is deleted from DB
- p2 is deleted from DB
- r1 is not deleted from host1 though there are no more ports on it

Fix proposed to branch: master
Review: https://review.openstack.org/272634

Changed in neutron:
status: New → In Progress

Reviewed: https://review.openstack.org/272634
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c74265efb9339bee6011851d8a160067854a2818
Submitter: Jenkins
Branch: master

commit c74265efb9339bee6011851d8a160067854a2818
Author: Oleg Bondarev <email address hidden>
Date: Tue Jan 26 18:01:50 2016 +0300

    DVR: avoid race on dvr serviceable port deletion

    Please see race details in the bug report.
    The fix is to check for dvr routers that needs to be removed
    after actual port deletion.
    As a bonus we can get rid of dvr logic in ml2 plugin delete_port().

    It's hard to come up with a test here as race can only be
    reproduced with multiple API workers.

    Closes-Bug: #1538163
    Change-Id: I7ab1b0c18e5daa6f35a37370b9be79e689e2ba50

Changed in neutron:
status: In Progress → Fix Released

This issue was fixed in the openstack/neutron 8.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers