You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/28 14:22:43 UTC

[23/50] mem3 commit: updated refs/heads/master to 64c0c74

Allow skip straight to global phase

When rebalancing a DB-per-user cluster with small Q values its typical
that

a) the local phase takes a loooong time, and
b) the local phase doesn't suggest any moves

While the local phase should still run at least once, we'll expose a
flag to skip straight to the global phase since we'll need to run the
plan generator many many times and we can't afford to wait.

BugzID: 24680


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/0b0a7e79
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/0b0a7e79
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/0b0a7e79

Branch: refs/heads/master
Commit: 0b0a7e7935d3e43f378908157a05ac2c74c7a5f5
Parents: 45b040b
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Wed Oct 30 10:00:08 2013 -0400
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 23 18:46:26 2014 +0100

----------------------------------------------------------------------
 src/mem3_rebalance.erl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/0b0a7e79/src/mem3_rebalance.erl
----------------------------------------------------------------------
diff --git a/src/mem3_rebalance.erl b/src/mem3_rebalance.erl
index 3c06596..7e0826b 100644
--- a/src/mem3_rebalance.erl
+++ b/src/mem3_rebalance.erl
@@ -40,8 +40,12 @@
 expand() ->
     expand(1000).
 
+%% @doc Expands a cluster without requiring each DB to be optimally balanced.
+-spec expand(integer() | global) -> [{atom(), #shard{}, node()}].
+expand(global) ->
+    global_expand(surviving_nodes(), [], 1000);
+
 %% @doc Expands all databases in the cluster, stopping at Limit operations.
--spec expand(integer()) -> [{atom(), #shard{}, node()}].
 expand(Limit) when is_integer(Limit), Limit > 0 ->
     TargetNodes = surviving_nodes(),
     LocalBalanceFun = fun(Db, Moves) -> expand(Db, TargetNodes, Moves) end,