Revert "For deterministic IPs, check if the designated node can host the ip before"
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 5 Aug 2010 05:41:35 +0000 (15:41 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 5 Aug 2010 05:41:35 +0000 (15:41 +1000)
This reverts commit 5e60aad0e19cabb29c3be191698e10049da151c7.

This change lowers the "flapping" but at the expense of less balance.
Keeping the system balancved is likely better than minimizing the amount of flapping
for this configuration

server/ctdb_takeover.c

index d0de683f6b09e12634e46856b03d271c0a38f52c..cb65f29d751b7c94ab0b2b64cb0a51296ea04d27 100644 (file)
@@ -737,7 +737,7 @@ create_merged_ip_list(struct ctdb_context *ctdb)
  */
 int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap)
 {
-       int i, num_healthy, retries, num_ips;
+  int i, num_healthy, retries, num_ips;
        struct ctdb_public_ip ip;
        struct ctdb_public_ipv4 ipv4;
        uint32_t mask;
@@ -795,12 +795,7 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap)
        if (1 == ctdb->tunable.deterministic_public_ips) {              
                DEBUG(DEBUG_NOTICE,("Deterministic IPs enabled. Resetting all ip allocations\n"));
                for (i=0,tmp_ip=all_ips;tmp_ip;tmp_ip=tmp_ip->next,i++) {
-                       int tmp_pnn;
-
-                       tmp_pnn = i%nodemap->num;
-                       if (can_node_serve_ip(ctdb, tmp_pnn, tmp_ip) == 0) {
-                               tmp_ip->pnn = tmp_pnn;
-                       }
+                       tmp_ip->pnn = i%nodemap->num;
                }
        }