LCP IP allocation algorithm - try harder to find a candidate source node
authorMartin Schwenke <martin@meltin.net>
Tue, 1 Nov 2011 09:52:57 +0000 (20:52 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 14 Feb 2012 01:18:05 +0000 (12:18 +1100)
commit91028144aa281a8f2ee915048c7c35d6c8a1d8df
treecd99dc4d672c311de109fb8d455d0bd742b45a1d
parentd9579c2971659f1ebc218a339d28f15132dd5718
LCP IP allocation algorithm - try harder to find a candidate source node

There's a bug in LCP2.  Selecting the node with the highest imbalance
doesn't always work.  Some nodes can have a high imbalance metric
because they have a lot of IPs.  However, these nodes can be part of a
group that is perfectly balanced.  Nodes in another group with less
IPs might actually be imbalanced.

Instead of just trying the source node with the highest imbalance this
tries them in descending order of imbalance until it finds one where
an IP can be moved to another node.

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