You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2020/02/24 17:43:06 UTC

[couchdb] branch prototype/fdb-layer updated: Do not use the ddoc cache to load _changes filter design documents

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/prototype/fdb-layer by this push:
     new af69ab5  Do not use the ddoc cache to load _changes filter design documents
af69ab5 is described below

commit af69ab599fcc08b8734c6375e23439e80982b738
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Fri Feb 21 21:49:14 2020 -0500

    Do not use the ddoc cache to load _changes filter design documents
    
    Since we started re-using the main changes feed transaction to open the docs
    https://github.com/apache/couchdb/commit/1bceb552594af404961e4ab8e6f88cffa1548f69,
    we also started to pass the transactional db handle to the ddoc cache. However
    ddoc cache uses a `spawn_monitor` to open docs, and since our transaction
    objects are tied to the owner process the open was failing with a `badarg`
    error from erlfdb.
    
    This could be seen by running the replication elixir tests:
    
    ```
    make elixir tests=test/elixir/test/replication_test.exs:214
    ```
---
 src/chttpd/src/chttpd_changes.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/chttpd/src/chttpd_changes.erl b/src/chttpd/src/chttpd_changes.erl
index 81fa90f..31c39bf 100644
--- a/src/chttpd/src/chttpd_changes.erl
+++ b/src/chttpd/src/chttpd_changes.erl
@@ -393,7 +393,7 @@ check_fields(_Fields) ->
 
 
 open_ddoc(Db, DDocId) ->
-    case ddoc_cache:open_doc(Db, DDocId) of
+    case fabric2_db:open_doc(Db, DDocId, [ejson_body, ?ADMIN_CTX]) of
         {ok, _} = Resp -> Resp;
         Else -> throw(Else)
     end.