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>
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;
}