couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [27/50] mem3 commit: updated refs/heads/master to 64c0c74
Date Thu, 28 Aug 2014 12:22:47 GMT
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 <robert.newson@cloudant.com>
Authored: Wed Jul 31 11:14:30 2013 +0100
Committer: Robert Newson <rnewson@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


Mime
View raw message