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 2016/05/15 13:06:00 UTC

mem3 commit: updated refs/heads/master to 8614279

Repository: couchdb-mem3
Updated Branches:
  refs/heads/master 0b70afb7c -> 861427999


Pass ADMIN_CTX when opening dbs

COUCHDB-3016


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

Branch: refs/heads/master
Commit: 861427999a45f34040f13525bd7b2db75c863b26
Parents: 0b70afb
Author: Robert Newson <rn...@apache.org>
Authored: Tue May 10 21:02:53 2016 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Tue May 10 21:20:19 2016 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/86142799/src/mem3_util.erl
----------------------------------------------------------------------
diff --git a/src/mem3_util.erl b/src/mem3_util.erl
index ea43473..2cd444d 100644
--- a/src/mem3_util.erl
+++ b/src/mem3_util.erl
@@ -78,7 +78,7 @@ attach_nodes([S | Rest], Acc, [Node | Nodes], UsedNodes) ->
 
 open_db_doc(DocId) ->
     DbName = ?l2b(config:get("mem3", "shards_db", "_dbs")),
-    {ok, Db} = couch_db:open(DbName, []),
+    {ok, Db} = couch_db:open(DbName, [?ADMIN_CTX]),
     try couch_db:open_doc(Db, DocId, [ejson_body]) after couch_db:close(Db) end.
 
 write_db_doc(Doc) ->
@@ -86,7 +86,7 @@ write_db_doc(Doc) ->
     write_db_doc(DbName, Doc, true).
 
 write_db_doc(DbName, #doc{id=Id, body=Body} = Doc, ShouldMutate) ->
-    {ok, Db} = couch_db:open(DbName, []),
+    {ok, Db} = couch_db:open(DbName, [?ADMIN_CTX]),
     try couch_db:open_doc(Db, Id, [ejson_body]) of
     {ok, #doc{body = Body}} ->
         % the doc is already in the desired state, we're done here
@@ -112,7 +112,7 @@ delete_db_doc(DocId) ->
     delete_db_doc(DbName, DocId, true).
 
 delete_db_doc(DbName, DocId, ShouldMutate) ->
-    {ok, Db} = couch_db:open(DbName, []),
+    {ok, Db} = couch_db:open(DbName, [?ADMIN_CTX]),
     {ok, Revs} = couch_db:open_doc_revs(Db, DocId, all, []),
     try [Doc#doc{deleted=true} || {ok, #doc{deleted=false}=Doc} <- Revs] of
     [] ->