From 3a3b3bdd8a7b1bde95595c18176ac2dbc40164ca Mon Sep 17 00:00:00 2001 From: Nick Vatamaniuc Date: Fri, 21 Feb 2020 21:49:14 -0500 Subject: 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 81fa90fab..31c39bfb7 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. -- cgit v1.2.1