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>
Sun, 5 Feb 2012 22:00:06 +0000 (09:00 +1100)
commit3ea1879864cf286c51b70efde6ee06b9cd9bcf2b
treecd99dc4d672c311de109fb8d455d0bd742b45a1d
parentf308b7027df9a6c35c845306ed7b72568ea6b81a
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