DVR: Multiple csnat ports created when RouterPort table update fails
When router interfaces are added to DVR router, if the router has
gateway configured, then the internal csnat ports are created for
the corresponding router interfaces.
We have seen recently after the csnat port is created if the
RouterPort table update fails, there is a DB retry that is happening
and that retry operation is creating an additional csnat port.
This additional port is not getting removed automatically when the
router interfaces are deleted.
This issue is seen when testing with a simple heat template as
per the bug report.
This patch fixes the issue by calling the RouterPort create with
delete_port_on_error context.
Reviewed: https:/ /review. opendev. org/527952 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=2028a66f21a f596cd59e2a6f7d 9bb05f6d5f7292
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit 2028a66f21af596 cd59e2a6f7d9bb0 5f6d5f7292
Author: Swaminathan Vasudevan <email address hidden>
Date: Wed Aug 16 21:48:08 2017 -0700
DVR: Multiple csnat ports created when RouterPort table update fails
When router interfaces are added to DVR router, if the router has
gateway configured, then the internal csnat ports are created for
the corresponding router interfaces.
We have seen recently after the csnat port is created if the
RouterPort table update fails, there is a DB retry that is happening
and that retry operation is creating an additional csnat port.
This additional port is not getting removed automatically when the
router interfaces are deleted.
This issue is seen when testing with a simple heat template as
per the bug report.
This patch fixes the issue by calling the RouterPort create with port_on_ error context.
delete_
Conflicts:
neutron/ db/l3_dvr_ db.py
neutron/ tests/unit/ db/test_ l3_dvr_ db.py
Change-Id: I916011f2200f02 556ebb30bce30e3 49a8023602c 2b0c3d22550f00f 3c7adc7f33)
Closes-Bug: #1709774
(cherry picked from commit 8c3cb2e15b48f5e
Signed-off-by: Mikhail Ushanov <email address hidden>