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/22 02:55:25 UTC

[couchdb] 01/01: Do not use the ddoc cache to load filter design documents

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

vatamane pushed a commit to branch fix-changes-filter
in repository https://gitbox.apache.org/repos/asf/couchdb.git

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

    Do not use the ddoc cache to load filter design documents
    
    Since we started re-using the main changes feed transation to read docs
    (https://github.com/apache/couchdb/commit/1bceb552594af404961e4ab8e6f88cffa1548f69)
    we also started to pass the transactional db handle to ddoc cache. However ddoc
    cache uses a spawn_monitor to load to open the doc and since our transaction
    object are tied to a single "owner" process the load was failing with a badarg
    from erlfdb module.
    
    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.