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)
committerMartin Schwenke <martin@meltin.net>
Tue, 1 Nov 2011 23:17:00 +0000 (10:17 +1100)
commit574091d5aced5e87aefad52f8bc47aa75c25fbf6
tree9c771974964f012323bbd66392ee17679a2becb1
parent1d26e7cff6292fcbf63efc4628ffbb63b6f1f73c
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