Detect clustered dbs based on a missing id_btree

This function is called up in the HTTP coordinator so the usual trick of
detecting shard files based on the `shards/` prefix doesn't work.
Instead we can rely on the fact that the id_btree field is undefined.


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

Branch: refs/heads/windsor-merge
Commit: 4f9cb3551c84202bbd320588d47d3152dd9d6067
Parents: f1013bf
Author: Paul J. Davis <[email protected]>
Authored: Thu Aug 21 23:30:53 2014 -0500
Committer: Robert Newson <[email protected]>
Committed: Tue Aug 26 10:44:12 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/4f9cb355/src/couch_changes.erl
----------------------------------------------------------------------
diff --git a/src/couch_changes.erl b/src/couch_changes.erl
index 637a6ba..b5e8f89 100644
--- a/src/couch_changes.erl
+++ b/src/couch_changes.erl
@@ -225,9 +225,9 @@ check_docids(_) ->
     throw({bad_request, Msg}).
 
 
-open_ddoc(#db{name= <<"shards/", _/binary>> =ShardName}, DDocId) ->
+open_ddoc(#db{name=DbName, id_tree=undefined}, DDocId) ->
     {_, Ref} = spawn_monitor(fun() ->
-        exit(fabric:open_doc(mem3:dbname(ShardName), DDocId, []))
+        exit(fabric:open_doc(mem3:dbname(DbName), DDocId, [ejson_body]))
     end),
     receive
         {'DOWN', Ref, _, _, {ok, _}=Response} ->

Reply via email to