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/15 17:46:36 UTC

[couchdb] 01/01: Use {restart_tx, false} option in view index builder changes feed

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

vatamane pushed a commit to branch use-transactional-changes-in-indexer-feed
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit ccac76734312430083cd6a4bff4219ff67d65f57
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Sat Feb 15 12:27:25 2020 -0500

    Use {restart_tx, false} option in view index builder changes feed
    
    Index builder performs writes in the same transaction as the changes
    feed so we can't use iterators as they disable writes.
---
 src/couch_views/src/couch_views_indexer.erl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/couch_views/src/couch_views_indexer.erl b/src/couch_views/src/couch_views_indexer.erl
index 75e4b36..31cd8e6 100644
--- a/src/couch_views/src/couch_views_indexer.erl
+++ b/src/couch_views/src/couch_views_indexer.erl
@@ -211,7 +211,8 @@ fold_changes(State) ->
     } = State,
 
     Fun = fun process_changes/2,
-    fabric2_db:fold_changes(TxDb, SinceSeq, Fun, State, [{limit, Limit}]).
+    Opts = [{limit, Limit}, {restart_tx, false}],
+    fabric2_db:fold_changes(TxDb, SinceSeq, Fun, State, Opts).
 
 
 process_changes(Change, Acc) ->