when we reallocate the ip addresses for nodes, we must make sure that
authorRonnie Sahlberg <sahlberg@samba.org>
Sun, 2 Mar 2008 23:53:23 +0000 (10:53 +1100)
committerRonnie Sahlberg <sahlberg@samba.org>
Sun, 2 Mar 2008 23:53:23 +0000 (10:53 +1100)
a node that has been allocated to server an ip actually CAN serve that ip
(if we use differing public_addresses files on each node)

server/ctdb_takeover.c

index 6aaf41dd648df38f851f1c9d143c441f31b441c4..5b23f1eb96218c3300ba5f7eb45b3b553b4bdfe4 100644 (file)
@@ -706,6 +706,19 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap)
                }
        }
 
+       /* verify that the assigned nodes can serve that public ip
+          and set it to -1 if not
+       */
+       for (tmp_ip=all_ips;tmp_ip;tmp_ip=tmp_ip->next) {
+               if (tmp_ip->pnn == -1) {
+                       continue;
+               }
+               if (can_node_serve_ip(ctdb, tmp_ip->pnn, tmp_ip) != 0) {
+                       /* this node can not serve this ip. */
+                       tmp_ip->pnn = -1;
+               }
+       }
+
 
        /* now we must redistribute all public addresses with takeover node
           -1 among the nodes available