dont check the public ip assignment or if even we are hosting them and shouldnt
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 10 Nov 2010 01:06:05 +0000 (12:06 +1100)
committerMichael Adam <obnox@samba.org>
Fri, 6 Jun 2014 13:00:35 +0000 (15:00 +0200)
when public ips have been disabled
(cherry picked from commit 7d07a74dc7f907ac757d20626f68e257d7ba16be)

server/ctdb_recoverd.c

index 21aa55bf41154ae80d6431683f3c2f85cde3d9ce..89abbb315478323376a485e8df4e283925ffd532 100644 (file)
@@ -2571,18 +2571,20 @@ static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_rec
           active on the local node and wait for the recmaster
           to do a full blown recovery
        */
-       for (j=0; j<ips->num; j++) {
-               if (ips->ips[j].pnn == pnn) {
-                       if (!ctdb_sys_have_ip(&ips->ips[j].addr)) {
-                               DEBUG(DEBUG_CRIT,("Public address '%s' is missing and we should serve this ip\n",
-                                       ctdb_addr_to_str(&ips->ips[j].addr)));
-                               need_takeover_run = true;
-                       }
-               } else {
-                       if (ctdb_sys_have_ip(&ips->ips[j].addr)) {
-                               DEBUG(DEBUG_CRIT,("We are still serving a public address '%s' that we should not be serving.\n", 
-                                       ctdb_addr_to_str(&ips->ips[j].addr)));
-                               need_takeover_run = true;
+       if (ctdb->tunable.disable_ip_failover == 0) {
+               for (j=0; j<ips->num; j++) {
+                       if (ips->ips[j].pnn == pnn) {
+                               if (!ctdb_sys_have_ip(&ips->ips[j].addr)) {
+                                       DEBUG(DEBUG_CRIT,("Public address '%s' is missing and we should serve this ip\n",
+                                               ctdb_addr_to_str(&ips->ips[j].addr)));
+                                       need_takeover_run = true;
+                               }
+                       } else {
+                               if (ctdb_sys_have_ip(&ips->ips[j].addr)) {
+                                       DEBUG(DEBUG_CRIT,("We are still serving a public address '%s' that we should not be serving.\n", 
+                                               ctdb_addr_to_str(&ips->ips[j].addr)));
+                                       need_takeover_run = true;
+                               }
                        }
                }
        }
@@ -3101,7 +3103,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
        /* verify that we have all ip addresses we should have and we dont
         * have addresses we shouldnt have.
         */ 
-       if (ctdb->tunable.disable_ip_failover != 0) {
+       if (ctdb->tunable.disable_ip_failover == 0) {
                if (rec->ip_check_disable_ctx == NULL) {
                        if (verify_local_ip_allocation(ctdb, rec, pnn) != 0) {
                                DEBUG(DEBUG_ERR, (__location__ " Public IPs were inconsistent.\n"));