recoverd: Nodes to be used as forced rebalance targets must be healthy
authorMartin Schwenke <martin@meltin.net>
Fri, 6 Sep 2013 04:09:09 +0000 (14:09 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 10 Sep 2013 05:03:40 +0000 (15:03 +1000)
Right now, if a node is marked as a rebalance target then it can host
IPs even if it is unhealthy, inactive, ...

Also move the log message into the conditional so it is only generated
if the PNN is actually going to be a rebalancing target.

Signed-off-by: Martin Schwenke <martin@meltin.net>
server/ctdb_takeover.c

index 9fdf2278591f4c61134258afe8756249c796005c..721be294ae8fc4c31c4ef4e2d89a242ec781c7b0 100644 (file)
@@ -1556,11 +1556,12 @@ void lcp2_init(struct ctdb_context * tmp_ctx,
        while (force_rebalance_list != NULL) {
                struct ctdb_rebalancenodes *next = force_rebalance_list->next;
 
-               if (force_rebalance_list->pnn <= nodemap->num) {
+               if (force_rebalance_list->pnn <= nodemap->num &&
+                   !(nodemap->nodes[force_rebalance_list->pnn].flags & mask)) {
                        (*newly_healthy)[force_rebalance_list->pnn] = true;
+                       DEBUG(DEBUG_ERR,("During ipreallocation, forced rebalance of node %d\n", force_rebalance_list->pnn));
                }
 
-               DEBUG(DEBUG_ERR,("During ipreallocation, forced rebalance of node %d\n", force_rebalance_list->pnn));
                talloc_free(force_rebalance_list);
                force_rebalance_list = next;
        }