ctdb-daemon: Skip "IP on interface" checks if DisableIPFailover is set
authorMartin Schwenke <martin@meltin.net>
Thu, 7 May 2015 10:41:55 +0000 (20:41 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 13 May 2015 04:42:13 +0000 (06:42 +0200)
To support external failover of IP addresses if DisableIPFailover is
set.  CTDB's idea of IP address assignment can be manipulated using
"ctdb moveip".  Checking if the IP address is already held breaks
this in several places.

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 7c18542d0bed43fd04a48bcf73939d4511eb6d37..b4c930b649425a9b46e7220705c0f36bcf50d014 100644 (file)
@@ -720,7 +720,7 @@ int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
                return 0;
        }
 
-       if (ctdb->do_checkpublicip) {
+       if (ctdb->tunable.disable_ip_failover == 0 && ctdb->do_checkpublicip) {
                have_ip = ctdb_sys_have_ip(&pip->addr);
        }
        best_iface = ctdb_vnn_best_iface(ctdb, vnn);
@@ -873,7 +873,7 @@ static void release_ip_callback(struct ctdb_context *ctdb, int status,
                ctdb_ban_self(ctdb);
        }
 
-       if (ctdb->do_checkpublicip) {
+       if (ctdb->tunable.disable_ip_failover == 0 && ctdb->do_checkpublicip) {
                if  (ctdb_sys_have_ip(state->addr)) {
                        DEBUG(DEBUG_ERR,
                              ("IP %s still hosted during release IP callback, failing\n",
@@ -952,7 +952,7 @@ int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
         * intended new node.  The following causes makes ctdbd ignore
         * a release for any address it doesn't host.
         */
-       if (ctdb->do_checkpublicip) {
+       if (ctdb->tunable.disable_ip_failover == 0 && ctdb->do_checkpublicip) {
                if (!ctdb_sys_have_ip(&pip->addr)) {
                        DEBUG(DEBUG_DEBUG,("Redundant release of IP %s/%u on interface %s (ip not held)\n",
                                ctdb_addr_to_str(&pip->addr),