add a new tunable 'NoIPFailback'
authorRonnie Sahlberg <sahlberg@samba.org>
Mon, 3 Mar 2008 01:52:16 +0000 (12:52 +1100)
committerRonnie Sahlberg <sahlberg@samba.org>
Mon, 3 Mar 2008 01:52:16 +0000 (12:52 +1100)
when this tunable is set, ip addresses will only be failed over when a node
fails. And only those ip addresses held by the failed node will be reallocated
in the cluster.

When a node becomes active again, this will not lead to any failback of ip addresses.

This can reduce the number of "ip address movements" in the cluster since we dont automatically fail an ip address back, but can also lead to an unbalanced cluster since we no longer attempt to spread the ip addresses out evenly across the active nodes.

This tuneable can NOT be active at the same time as DeterministicIPs are used.

include/ctdb_private.h
server/ctdb_takeover.c
server/ctdb_tunables.c

index c8491b3c1508c63ee23ebac58b54c7a48b4dd64e..918f5d71843054c3b2fec6facfea813ff0251831 100644 (file)
@@ -91,6 +91,7 @@ struct ctdb_tunable {
        uint32_t deterministic_public_ips;
        uint32_t disable_when_unhealthy;
        uint32_t reclock_ping_period;
+       uint32_t no_ip_failback;
 };
 
 /*
index 5b23f1eb96218c3300ba5f7eb45b3b553b4bdfe4..a25a6cf2fda4281e7f6b0ca721cb7593a77ffe74 100644 (file)
@@ -736,6 +736,18 @@ try_again:
                }
        }
 
+       /* If we dont want ips to fail back after a node becomes healthy
+          again, we wont even try to reallocat the ip addresses so that
+          they are evenly spread out.
+          This can NOT be used at the same time as DeterministicIPs !
+       */
+       if (1 == ctdb->tunable.no_ip_failback) {
+               if (1 == ctdb->tunable.deterministic_public_ips) {
+                       DEBUG(DEBUG_ERR, ("ERROR: You can not use 'DeterministicIPs' and 'NoIPFailback' at the same time\n"));
+               }
+               goto finished;
+       }
+
 
        /* now, try to make sure the ip adresses are evenly distributed
           across the node.
@@ -821,6 +833,10 @@ try_again:
        }
 
 
+       /* finished distributing the public addresses, now just send the 
+          info out to the nodes
+       */
+finished:
 
        /* at this point ->pnn is the node which will own each IP
           or -1 if there is no node that can cover this ip
index 8d6c4f974065776e5041dd0c5e16dcd3e8cf1bd0..4e36970c23afee7492b19f68fc719a98382318ce 100644 (file)
@@ -46,7 +46,8 @@ static const struct {
        { "EnableBans",           1,  offsetof(struct ctdb_tunable, enable_bans) },
        { "DeterministicIPs",     1,  offsetof(struct ctdb_tunable, deterministic_public_ips) },
        { "DisableWhenUnhealthy", 0,  offsetof(struct ctdb_tunable, disable_when_unhealthy) },
-       { "ReclockPingPeriod",   60, offsetof(struct ctdb_tunable,  reclock_ping_period) },
+       { "ReclockPingPeriod",   60,  offsetof(struct ctdb_tunable,  reclock_ping_period) },
+       { "NoIPFailback",         0,  offsetof(struct ctdb_tunable, no_ip_failback) },
 };
 
 /*