LCP IP allocation algorithm - new function lcp2_failback_candidate()
authorMartin Schwenke <martin@meltin.net>
Tue, 1 Nov 2011 08:49:38 +0000 (19:49 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 8 Nov 2011 23:24:53 +0000 (10:24 +1100)
commitd595c57e7602a662055192297817849a15c6128b
tree2157ad41038c7a4dc50c26132546c54b35d2c62d
parent6568feec47b705a39c404bb1a5ff35db265aea6a
LCP IP allocation algorithm - new function lcp2_failback_candidate()

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.

Factor out the code from lcp2_failback() that actually takes a node
and decides which address should be moved to which node.

This is the first step in fixing the above bug.

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