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

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

Ensure that the owner of a doc is also a host

BugzID: 24395


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

Branch: refs/heads/master
Commit: 19c3ee2cd9ea4941505db7f54fbf257e740586ae
Parents: aef5866
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Tue Oct 22 15:29:00 2013 -0400
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 23 18:46:26 2014 +0100

----------------------------------------------------------------------
 src/mem3_util.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/19c3ee2c/src/mem3_util.erl
----------------------------------------------------------------------
diff --git a/src/mem3_util.erl b/src/mem3_util.erl
index 0927493..be7302d 100644
--- a/src/mem3_util.erl
+++ b/src/mem3_util.erl
@@ -224,7 +224,7 @@ ensure_exists(DbName) ->
 
 
 owner(DbName, DocId) ->
-    Nodes = lists:sort([node()|nodes()]),
+    Nodes = lists:sort([N || #shard{node=N} <- mem3:shards(DbName, DocId)]),
     node() =:= hd(rotate_list({DbName, DocId}, Nodes)).
 
 is_deleted(Change) ->