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/02/03 14:00:01 UTC

[22/27] couchdb commit: updated refs/heads/1843-feature-bigcouch to 465d1ad

Add ejson_body to all mem3 open_doc attempts that need it


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

Branch: refs/heads/1843-feature-bigcouch
Commit: 06a07d271033c9bdeb3ef71e6b93deaae893f2d3
Parents: a1eea29
Author: Robert Newson <rn...@apache.org>
Authored: Mon Dec 23 16:55:10 2013 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Mon Feb 3 12:54:10 2014 +0000

----------------------------------------------------------------------
 src/mem3/src/mem3_nodes.erl  | 2 +-
 src/mem3/src/mem3_rep.erl    | 2 +-
 src/mem3/src/mem3_shards.erl | 4 ++--
 src/mem3/src/mem3_util.erl   | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/06a07d27/src/mem3/src/mem3_nodes.erl
----------------------------------------------------------------------
diff --git a/src/mem3/src/mem3_nodes.erl b/src/mem3/src/mem3_nodes.erl
index ad96646..782a8b5 100644
--- a/src/mem3/src/mem3_nodes.erl
+++ b/src/mem3/src/mem3_nodes.erl
@@ -113,7 +113,7 @@ first_fold(#full_doc_info{id = <<"_design/", _/binary>>}, _, Acc) ->
 first_fold(#full_doc_info{deleted=true}, _, Acc) ->
     {ok, Acc};
 first_fold(#full_doc_info{id=Id}=DocInfo, _, Db) ->
-    {ok, #doc{body={Props}}} = couch_db:open_doc(Db, DocInfo),
+    {ok, #doc{body={Props}}} = couch_db:open_doc(Db, DocInfo, [ejson_body]),
     ets:insert(?MODULE, {mem3_util:to_atom(Id), Props}),
     {ok, Db}.
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/06a07d27/src/mem3/src/mem3_rep.erl
----------------------------------------------------------------------
diff --git a/src/mem3/src/mem3_rep.erl b/src/mem3/src/mem3_rep.erl
index 09fff9c..373bc3f 100644
--- a/src/mem3/src/mem3_rep.erl
+++ b/src/mem3/src/mem3_rep.erl
@@ -195,7 +195,7 @@ rexi_call(Node, MFA) ->
     end.
 
 calculate_start_seq(Db, #shard{node=Node, name=Name}, LocalId) ->
-    case couch_db:open_doc(Db, LocalId, []) of
+    case couch_db:open_doc(Db, LocalId, [ejson_body]) of
     {ok, #doc{body = {SProps}}} ->
         Opts = [{user_ctx, ?CTX}, {io_priority, {internal_repl, Name}}],
         try rexi_call(Node, {fabric_rpc, open_doc, [Name, LocalId, Opts]}) of

http://git-wip-us.apache.org/repos/asf/couchdb/blob/06a07d27/src/mem3/src/mem3_shards.erl
----------------------------------------------------------------------
diff --git a/src/mem3/src/mem3_shards.erl b/src/mem3/src/mem3_shards.erl
index 3437495..9949869 100644
--- a/src/mem3/src/mem3_shards.erl
+++ b/src/mem3/src/mem3_shards.erl
@@ -177,7 +177,7 @@ fold_fun(#full_doc_info{}=FDI, _, Acc) ->
     DI = couch_doc:to_doc_info(FDI),
     fold_fun(DI, nil, Acc);
 fold_fun(#doc_info{}=DI, _, {Db, UFun, UAcc}) ->
-    case couch_db:open_doc(Db, DI, [conflicts]) of
+    case couch_db:open_doc(Db, DI, [ejson_body, conflicts]) of
         {ok, Doc} ->
             {Props} = Doc#doc.body,
             Shards = mem3_util:build_shards(Doc#doc.id, Props),
@@ -242,7 +242,7 @@ load_shards_from_disk(DbName) when is_binary(DbName) ->
     end.
 
 load_shards_from_db(#db{} = ShardDb, DbName) ->
-    case couch_db:open_doc(ShardDb, DbName, []) of
+    case couch_db:open_doc(ShardDb, DbName, [ejson_body]) of
     {ok, #doc{body = {Props}}} ->
         Shards = mem3_util:build_shards(DbName, Props),
         gen_server:cast(?MODULE, {cache_insert, DbName, Shards}),

http://git-wip-us.apache.org/repos/asf/couchdb/blob/06a07d27/src/mem3/src/mem3_util.erl
----------------------------------------------------------------------
diff --git a/src/mem3/src/mem3_util.erl b/src/mem3/src/mem3_util.erl
index 610e284..4460df6 100644
--- a/src/mem3/src/mem3_util.erl
+++ b/src/mem3/src/mem3_util.erl
@@ -69,7 +69,7 @@ attach_nodes([S | Rest], Acc, [Node | Nodes], UsedNodes) ->
 open_db_doc(DocId) ->
     DbName = ?l2b(config:get("mem3", "shard_db", "dbs")),
     {ok, Db} = couch_db:open(DbName, []),
-    try couch_db:open_doc(Db, DocId, []) after couch_db:close(Db) end.
+    try couch_db:open_doc(Db, DocId, [ejson_body]) after couch_db:close(Db) end.
 
 write_db_doc(Doc) ->
     DbName = ?l2b(config:get("mem3", "shard_db", "dbs")),
@@ -77,7 +77,7 @@ write_db_doc(Doc) ->
 
 write_db_doc(DbName, #doc{id=Id, body=Body} = Doc, ShouldMutate) ->
     {ok, Db} = couch_db:open(DbName, []),
-    try couch_db:open_doc(Db, Id, []) of
+    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
         ok;