ctdb-daemon: Don't update IP tree if DisableIPFailover is set
authorMartin Schwenke <martin@meltin.net>
Fri, 8 May 2015 03:14:34 +0000 (13:14 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 13 May 2015 04:42:13 +0000 (06:42 +0200)
There won't be an IP tree.  It is only ever initialised during a
takeover run.

The alternate to this would be to avoid sending
CTDB_SRVID_RECD_UPDATE_IP in "ctdb moveip".  This logic is probably
best kept out of the CLI tool.

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

index e6b70e13cebfa12e0395163f7828a9b66b262985..e37f193b7fb0d5f714edb1d16cae71165937798b 100644 (file)
@@ -4234,7 +4234,12 @@ int verify_remote_ip_allocation(struct ctdb_context *ctdb,
 
 int update_ip_assignment_tree(struct ctdb_context *ctdb, struct ctdb_public_ip *ip)
 {
-       struct ctdb_public_ip_list *tmp_ip; 
+       struct ctdb_public_ip_list *tmp_ip;
+
+       /* IP tree is never built if DisableIPFailover is set */
+       if (ctdb->tunable.disable_ip_failover != 0) {
+               return 0;
+       }
 
        if (ctdb->ip_tree == NULL) {
                DEBUG(DEBUG_ERR,("No ctdb->ip_tree yet. Failed to update ip assignment\n"));