From: Martin Schwenke Date: Fri, 7 Feb 2014 03:28:54 +0000 (+1100) Subject: ctdb-recoverd: Optimise check for rebalance candidates in LCP2 X-Git-Tag: tdb-1.2.13~333 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e5ef44f32fad6606bd95e619f0720a72344e441;p=thirdparty%2Fsamba.git ctdb-recoverd: Optimise check for rebalance candidates in LCP2 Currently this can be checked many times. However, there's no point calling the rebalance/failback code at all if there are no rebalance candidates. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index d3a6e25aa3a..bdf45603e46 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -1998,28 +1998,13 @@ static void lcp2_failback(struct ctdb_context *ctdb, uint32_t *lcp2_imbalances, bool *rebalance_candidates) { - int i, num_rebalance_candidates, numnodes; + int i, numnodes; struct lcp2_imbalance_pnn * lips; bool again; numnodes = talloc_array_length(ipflags); try_again: - - /* It is only worth continuing if we have suitable target - * nodes to transfer IPs to. This check is much cheaper than - * continuing on... - */ - num_rebalance_candidates = 0; - for (i=0; i