diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2021-03-02 22:17:47 -0500 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2021-03-02 22:17:47 -0500 |
commit | dbbab649dc5cbca50664ab3f7c33147e6010a106 (patch) | |
tree | f892477c2a02897fa4c203e1197a5ef17ef01b3f | |
parent | 2e40063aae17658138bfaffa2304b5e461e43e30 (diff) | |
download | couchdb-advance-dbseq-during-indexing-retry.tar.gz |
Require subscribers to wait until indexer finishesadvance-dbseq-during-indexing-retry
This clause allowed a subscriber to start reading a view as soon as the
indexer made it past the sequence of interest. The trouble with that
approach is the resulting view is not directly related to any snapshot
of the underlying DB. Waiting until the indexer finishes allows us to
provide better semantics, where the view observes a consistent snapshot
of the database at some point in time >= the requested sequence.
In order to see this work through the view reader should explicitly set
the read version of FDB to match the commit version introduced by the
indexer, to avoid seeing partial results from a follow-on indexing job.
-rw-r--r-- | src/couch_views/src/couch_views_jobs.erl | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/couch_views/src/couch_views_jobs.erl b/src/couch_views/src/couch_views_jobs.erl index 4b0aa2660..17b4c0da7 100644 --- a/src/couch_views/src/couch_views_jobs.erl +++ b/src/couch_views/src/couch_views_jobs.erl @@ -121,9 +121,6 @@ wait_for_job(JobId, Subscription, DDocId, UpdateSeq) -> ok; {finished, _} -> wait_for_job(JobId, DDocId, UpdateSeq); - {_State, #{<<"view_seq">> := ViewSeq}} when ViewSeq >= UpdateSeq -> - couch_jobs:unsubscribe(Subscription), - ok; {_, _} -> wait_for_job(JobId, Subscription, DDocId, UpdateSeq) end. |