diff options
author | Martin Schwenke <martin@meltin.net> | 2014-02-07 17:19:20 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-02-13 02:03:24 +0100 |
commit | f1a20d748f6ab4702be5b17047a3fbfa0f3e8d0c (patch) | |
tree | cb321633e223ad8547af3f163a5b2923d4f80e3b /ctdb/server | |
parent | 50fc53d7f11a3c28fd4ef5318d90f842bbc0f19c (diff) | |
download | samba-f1a20d748f6ab4702be5b17047a3fbfa0f3e8d0c.tar.gz samba-f1a20d748f6ab4702be5b17047a3fbfa0f3e8d0c.tar.xz samba-f1a20d748f6ab4702be5b17047a3fbfa0f3e8d0c.zip |
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>
Diffstat (limited to 'ctdb/server')
-rw-r--r-- | ctdb/server/ctdb_takeover.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index c21736ed085..d3a6e25aa3a 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -1958,7 +1958,7 @@ static bool lcp2_failback_candidate(struct ctdb_context *ctdb, mindstnode, mindstimbl - lcp2_imbalances[mindstnode])); - lcp2_imbalances[srcnode] = srcimbl; + lcp2_imbalances[srcnode] = minsrcimbl; lcp2_imbalances[mindstnode] = mindstimbl; minip->pnn = mindstnode; @@ -2024,10 +2024,13 @@ try_again: * iterate through candidates. Usually the 1st one will be * used, so this doesn't cost much... */ + DEBUG(DEBUG_DEBUG,("+++++++++++++++++++++++++++++++++++++++++\n")); + DEBUG(DEBUG_DEBUG,("Selecting most imbalanced node from:\n")); lips = talloc_array(ctdb, struct lcp2_imbalance_pnn, numnodes); for (i=0; i<numnodes; i++) { lips[i].imbalance = lcp2_imbalances[i]; lips[i].pnn = i; + DEBUG(DEBUG_DEBUG,(" %d [%d]\n", i, lcp2_imbalances[i])); } qsort(lips, numnodes, sizeof(struct lcp2_imbalance_pnn), lcp2_cmp_imbalance_pnn); |