From 3c7bcea368dc8f68e8e82cc527cf588dcff453c8 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 8 May 2015 17:11:24 +1000 Subject: [PATCH] ctdb-daemon: Mark interfaces as "up" by default The potential for public IP addresses to shuffle around during node initialisation disappeared a while ago because IP addresses can only be assigned to a node that is in CTDB_RUNSTATE_RUNNING. This means that interfaces might as well just be initialised as "up". If any interfaces are actually "down" then this will be rectified by the "startup" event in 10.interfaces. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/server/ctdb_takeover.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index b4c930b6494..e6b70e13ceb 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -72,20 +72,8 @@ static int ctdb_add_local_iface(struct ctdb_context *ctdb, const char *iface) CTDB_NO_MEMORY_FATAL(ctdb, i); i->name = talloc_strdup(i, iface); CTDB_NO_MEMORY(ctdb, i->name); - /* - * If link_up defaults to true then IPs can be allocated to a - * node during the first recovery. However, then an interface - * could have its link marked down during the startup event, - * causing the IP to move almost immediately. If link_up - * defaults to false then, during normal operation, IPs added - * to a new interface can't be assigned until a monitor cycle - * has occurred and marked the new interfaces up. This makes - * IP allocation unpredictable. The following is a neat - * compromise: early in startup link_up defaults to false, so - * IPs can't be assigned, and after startup IPs can be - * assigned immediately. - */ - i->link_up = (ctdb->runstate == CTDB_RUNSTATE_RUNNING); + + i->link_up = true; DLIST_ADD(ctdb->ifaces, i); -- 2.11.4.GIT