ctdb-ipalloc: A VNN can only host IPs if node is in RUNNING runstate
authorMartin Schwenke <martin@meltin.net>
Wed, 28 Oct 2015 09:41:08 +0000 (20:41 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 16 Nov 2015 07:42:11 +0000 (08:42 +0100)
This will allow wonderful simplification (i.e. removal) of some of the
runstate checking in the takeover run code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_takeover.c

index 813e364f2aca7dc4a7b68aac4e2eb4ca91ebeca1..e5c97c46d21ebd0c6c4aaf70d109011b2f7b1652 100644 (file)
@@ -261,6 +261,11 @@ static bool ctdb_vnn_available(struct ctdb_context *ctdb,
 {
        int i;
 
+       /* Nodes that are not RUNNING can not host IPs */
+       if (ctdb->runstate != CTDB_RUNSTATE_RUNNING) {
+               return false;
+       }
+
        if (vnn->delete_pending) {
                return false;
        }