]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Deleting HA router with attached port causes DB inconsistencies
authorYoni Shafrir <yshafrir@redhat.com>
Mon, 22 Dec 2014 09:25:39 +0000 (11:25 +0200)
committerYoni Shafrir <yshafrir@redhat.com>
Tue, 27 Jan 2015 13:46:59 +0000 (15:46 +0200)
commit7632f5dba619bbd9286708f59c31fa392b9c419c
tree0a17e435b069491d5e924e247bffda3fe71fe780
parent6510c32f04abbed06188efc31c557e1e72fb689c
Deleting HA router with attached port causes DB inconsistencies

When a HA router is being deleted with 'python-neutronclient'
while it has an attached interface the deletion will fail since
the router is in use. The order in which the deletion
is done is - first remove the HA interfaces from DB and
then delete the router. In this case the HA interfaces were
indeed deleted but the router itself was not (router is in use).
This causes the DB to be inconsistent where an HA router
exists in the DB while it's ports were removed from the DB.

This patch simply deletes the router first, and then
we know it's safe to remove it's HA interfaces as
well. If the router is in use and deletion fails
the HA interfaces remain intact.

Closes-Bug: #1402698

Change-Id: I956d0094ae6e2412e859d79feeb4003941d2bb4b
neutron/db/l3_hamode_db.py
neutron/tests/unit/db/test_l3_ha_db.py