ctdb-daemon: Mark interfaces as "up" by default
authorMartin Schwenke <martin@meltin.net>
Fri, 8 May 2015 07:11:24 +0000 (17:11 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 13 May 2015 04:42:13 +0000 (06:42 +0200)
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_takeover.c

index b4c930b649425a9b46e7220705c0f36bcf50d014..e6b70e13cebfa12e0395163f7828a9b66b262985 100644 (file)
@@ -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);