1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/ctdb/include
Martin Schwenke ff1a81c872 IP allocation - add LCP2 algorithm.
The current non-deterministic IP allocation algorithm balances IPs
across the whole cluster.  It does not consider different
interfaces/VLANs/subnets, so these different groups of IPs aren't
generally well balanced.

This adds the LCP2 algorithm for IP allocation and allows it to be
enabled by setting the "LCP2PublicIPs" tunable to 1.

The LCP2 algorithm calculates the imbalance of a node by totalling the
squares of the distances between each IP on the node.  The IP distance
is defined as the length longest common prefix (LCP) of bits that is
found when comparing 2 IPs.  The imbalance of a cluster is the maximum
imbalance for any node.  At each step the algorithm selects an
allocation to the IP/node combination that results in the choosing the
allocation that best reduces the imbalance of the cluster.

The implementation splits out the IP allocation part of
ctdb_takeover_run() into new function ctdb_takeover_run_core(), and
then extracts out the basic IP assignment code into new functions
basic_allocate_unassigned() and basic_failback().  3 new functions
lcp2_init(), lcp2_allocate_unassigned() and lcp2_failback() implement
the LCP2 algorithm, and are hooked into ctdb_takeover_run_core().

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 61fc7fbd0235469df22deb6581c6bd47e30bc0be)
2011-07-29 09:01:17 +10:00
..
cmdline.h moved cmdline.c to common code 2007-04-17 22:16:50 +10:00
ctdb_client.h Remove LACOUNT and LACCESSOR and migrate the records immediately. 2011-02-18 10:08:32 +11:00
ctdb_private.h IP allocation - add LCP2 algorithm. 2011-07-29 09:01:17 +10:00
ctdb_protocol.h ctdb_private.h: add record flag CTDB_REC_FLAG_AUTOMATIC 2011-03-14 13:35:51 +01:00
ctdb_typesafe_cb.h rename ccan/typesafe_cb.h to ctdb_typesafe_cb.h and 2010-06-02 09:18:48 +10:00
ctdb.h LIBCTDB: add support for traverse 2011-01-14 17:38:56 +11:00
idtree.h - added in idtree for efficient reqid handling 2006-11-28 20:48:34 +11:00
includes.h libctdb: reorganize headers: remove ctdb.h, add ctdb_client.h and ctdb_protocol.h 2010-05-20 15:18:30 +09:30