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, 8 Nov 2011 23:25:30 +0000 (10:25 +1100)
commit09577a797103c5a91fe816a3b9f385382e1791ca
tree8279dbb1823f3e48805cc1b1c3321a4a7e32b615
parentd595c57e7602a662055192297817849a15c6128b
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