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

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

Stabilize mem3_util:owner/2

BugzID: 21413


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

Branch: refs/heads/master
Commit: 720049ba273388e084fc1f2b7ab18e836595c063
Parents: 4b6f001
Author: Robert Newson <ro...@cloudant.com>
Authored: Wed Jul 31 11:14:30 2013 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 23 18:46:26 2014 +0100

----------------------------------------------------------------------
 src/mem3_util.erl | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/720049ba/src/mem3_util.erl
----------------------------------------------------------------------
diff --git a/src/mem3_util.erl b/src/mem3_util.erl
index 8e17393..0927493 100644
--- a/src/mem3_util.erl
+++ b/src/mem3_util.erl
@@ -224,10 +224,8 @@ ensure_exists(DbName) ->
 
 
 owner(DbName, DocId) ->
-    Shards = mem3:shards(DbName, DocId),
-    Ushards = mem3:ushards(DbName),
-    [Node] = [N || #shard{node=N} = S <- Shards, lists:member(S, Ushards)],
-    node() =:= Node.
+    Nodes = lists:sort([node()|nodes()]),
+    node() =:= hd(rotate_list({DbName, DocId}, Nodes)).
 
 is_deleted(Change) ->
     case couch_util:get_value(<<"deleted">>, Change) of