Fix wrong HA router state

When we add/remove router interface from HA router, l3 agent
will send SIGHUP signal to keepalived for reloading configuraion.

But for DVR+HA router, l3 agent will send SIGHUP signal TWICE which
will cause VRRP sub-process terminated and vip addresses and routes
left over. Keepalived then restart VRRP process and there will be
a re-election between VRRP peers. After the election, if the former
is still master, the state showed from Neutron will be correct. But
if the former master transitioned to backup, the new VRRP process
will NOT delete vips and routes because it is not the one who
configured them. There will be two active agent showed from Neutron.

HaRouter.enable_keepalived() will send SIGHUP signal to keepalived.
DvrEdgeHaRouter.process() should not call enable_keepalived() by
itself because it has inherited from class HaRouter.

Closes-Bug: 1602320
Change-Id: I647269665a22b4becb3e326e1f4b03ddd961d6b1
(cherry picked from commit 2b148c3f92)
This commit is contained in:
He Qing 2016-09-07 05:07:25 +00:00 committed by Assaf Muller
parent 37b886d431
commit fdaef357ea
1 changed files with 0 additions and 5 deletions

View File

@ -87,11 +87,6 @@ class DvrEdgeHaRouter(DvrEdgeRouter, HaRouter):
self._create_snat_namespace()
super(DvrEdgeHaRouter, self).initialize(process_monitor)
def process(self, agent):
super(DvrEdgeHaRouter, self).process(agent)
if self.ha_port:
self.enable_keepalived()
def get_router_cidrs(self, device):
return RouterInfo.get_router_cidrs(self, device)