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
This commit is contained in:
He Qing 2016-09-07 05:07:25 +00:00
parent 70615717b1
commit 2b148c3f92
1 changed files with 0 additions and 5 deletions

View File

@ -90,11 +90,6 @@ class DvrEdgeHaRouter(dvr_edge_router.DvrEdgeRouter,
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 router_info.RouterInfo.get_router_cidrs(self, device)