ctdb-recoverd: Fix a bug in the LCP2 rebalancing code
commitf1a20d748f6ab4702be5b17047a3fbfa0f3e8d0c
authorMartin Schwenke <martin@meltin.net>
Fri, 7 Feb 2014 06:19:20 +0000 (7 17:19 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 13 Feb 2014 01:03:24 +0000 (13 02:03 +0100)
treecb321633e223ad8547af3f163a5b2923d4f80e3b
parent50fc53d7f11a3c28fd4ef5318d90f842bbc0f19c
ctdb-recoverd: Fix a bug in the LCP2 rebalancing code

srcimbl gets changed on every iteration of the loop.  The value that
should be stored for the new imbalance of the source node is
minsrcimbl.

To help diagnose this, added some extra debug that can be left in.

The extra debug changes the output of a couple of tests.  Note that
the resulting IP allocations in those tests is unchanged - only the
debug output is changed.

Also add some new tests that illustrates the bug.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_takeover.c
ctdb/tests/takeover/lcp2.005.sh
ctdb/tests/takeover/lcp2.023.sh
ctdb/tests/takeover/lcp2.031.sh [new file with mode: 0755]
ctdb/tests/takeover/lcp2.032.sh [new file with mode: 0755]