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:35 UTC

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

we're not rotating by DbName any more


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

Branch: refs/heads/master
Commit: 0efb85e2d0f96004758a637b5ba764e1fc0e07a5
Parents: f2edc41
Author: Robert Newson <ro...@cloudant.com>
Authored: Tue Jun 25 12:36:59 2013 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 23 18:46:25 2014 +0100

----------------------------------------------------------------------
 src/mem3.erl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/0efb85e2/src/mem3.erl
----------------------------------------------------------------------
diff --git a/src/mem3.erl b/src/mem3.erl
index 96e058e..0046fd4 100644
--- a/src/mem3.erl
+++ b/src/mem3.erl
@@ -265,10 +265,10 @@ choose_ushards(DbName, Shards) ->
     Groups1 = [rotate_list(DbName, order_shards(G)) || G <- Groups0],
     [hd(G) || G <- Groups1].
 
-rotate_list(_DbName, []) ->
+rotate_list(_Key, []) ->
     [];
-rotate_list(DbName, List) ->
-    {H, T} = lists:split(erlang:crc32(DbName) rem length(List), List),
+rotate_list(Key, List) ->
+    {H, T} = lists:split(erlang:crc32(Key) rem length(List), List),
     T ++ H.
 
 order_shards([#ordered_shard{}|_]=OrderedShards) ->