DVR: Clean stale snat-ns by checking its existence when agent restarts
At present there is no clear way to distinguish when the snat_namespace
object is initialized and when the actual namespace is created.
There is no way to check if the namespace already existed. The
code was only checking at the snat_namespace object instead of its
existence.
This patch addresses the issue by adding in an exists method to the
namespace object to identify the existence of the namespace in the
given agent.
This would allow us to check for the existence of the namespace,
and also allow us to identify the stale snat namespace and
delete the namespace when the gateway is cleared as the agent restarts.
This also applies for conditions when the router is manually moved
from one agent to another agent while the agent is dead. When the
agent wakes up it would clean up the stale snat namespace.
Change-Id: Icb00297208813436c2a9e9a003275462293ad643
Closes-Bug: #1557909
(cherry picked from commit acd04d668bd414cd21f2715adc6a35a0eaed59a3)
Reviewed: https:/ /review. openstack. org/351923 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=6e5892da143 4a1a7674456aa4c 897480fbb0208b
Committed: https:/
Submitter: Jenkins
Branch: stable/mitaka
commit 6e5892da1434a1a 7674456aa4c8974 80fbb0208b
Author: Swaminathan Vasudevan <email address hidden>
Date: Tue Jun 7 13:31:56 2016 -0700
DVR: Clean stale snat-ns by checking its existence when agent restarts
At present there is no clear way to distinguish when the snat_namespace
object is initialized and when the actual namespace is created.
There is no way to check if the namespace already existed. The
code was only checking at the snat_namespace object instead of its
existence.
This patch addresses the issue by adding in an exists method to the
namespace object to identify the existence of the namespace in the
given agent.
This would allow us to check for the existence of the namespace,
and also allow us to identify the stale snat namespace and
delete the namespace when the gateway is cleared as the agent restarts.
This also applies for conditions when the router is manually moved 36c2a9e9a003275 462293ad643 d21f2715adc6a35 a0eaed59a3)
from one agent to another agent while the agent is dead. When the
agent wakes up it would clean up the stale snat namespace.
Change-Id: Icb002972088134
Closes-Bug: #1557909
(cherry picked from commit acd04d668bd414c