ViewEngine doesn't handle the case of empty default-collection

Description

CC ,

Test scenario:

  1. 1-node cluster, 1 bucket

  2. Store 1 alive doc + delete it -> just deletion at seqno:2 in the default collection

  3. Create a custom collection and store a doc in it

  4. Run compaction (use cbcompact with the right params for purging everything immediately) -> seqno:2 is purged, the default collection becomes empty

  5. Create a view on the UI

View creation gets stuck forever.

Views looping on:

couchdb:debug,2022-01-13T10:55:26.976+01:00,couchdb_n_0@cb.local:<0.20961.1>:couch_log:debug:27]Updater set view `example`, main group `_design/dev_test` Partition versions [{0,[{141906844413187,0}]}] [couchdb:info,2022-01-13T10:55:26.976+01:00,couchdb_n_0@cb.local:<0.20967.1>:couch_log:info:30]Updater reading changes from active partitions to update main set view group `_design/dev_test` from set `example` [couchdb:info,2022-01-13T10:55:26.977+01:00,couchdb_n_0@cb.local:<0.20967.1>:couch_log:info:30]Updater for main set view group `_design/dev_test`, set `example` (prod), read a total of 0 changes [couchdb:debug,2022-01-13T10:55:26.977+01:00,couchdb_n_0@cb.local:<0.20967.1>:couch_log:debug:27]Updater for main set view group `_design/dev_test`, set `example`, max partition seqs found:

KV:

2022-01-13T10:55:27.094391+01:00 INFO 52: (example) DCP (Producer) eq_dcpq:mapreduce_view: example _design/dev_test (prod/main) - (vb:0) Creating stream with start seqno 0 and end seqno 2; requested end seqno was 2, collections-filter-size:1 sid:none 2022-01-13T10:55:27.094430+01:00 INFO 52: (example) DCP (Producer) eq_dcpq:mapreduce_view: example _design/dev_test (prod/main) - (vb:0) ActiveStream::scheduleBackfill_UNLOCKED register cursor with name "eq_dcpq:mapreduce_view: example _design/dev_test (prod/main)" backfill:true, seqno:4 2022-01-13T10:55:27.094503+01:00 INFO 52: (example) DCP (Producer) eq_dcpq:mapreduce_view: example _design/dev_test (prod/main) - (vb:0) Scheduling backfill from 1 to 2, reschedule flag : False 2022-01-13T10:55:27.094873+01:00 WARNING 52: (example) DCP (Producer) eq_dcpq:mapreduce_view: example _design/dev_test (prod/main) - (vb:0) DCPBackfillBySeqnoDisk::markLegacyDiskSnapshot failed getBySeqno no such key 2022-01-13T10:55:27.094901+01:00 WARNING 52: (example) DCP (Producer) eq_dcpq:mapreduce_view: example _design/dev_test (prod/main) - (vb:0) Stream closing, sent until seqno 0 remaining items 0, reason: The stream closed early due to backfill failure 2022-01-13T10:55:27.094952+01:00 WARNING 52: (example) DCP (Producer) eq_dcpq:mapreduce_view: example _design/dev_test (prod/main) - (vb:0) ActiveStream::completeBackfillInner: Unexpected state_:dead

Components

Affects versions

Fix versions

Labels

Environment

None

Link to Log File, atop/blg, CBCollectInfo, Core dump

None

Release Notes Description

None

Activity

Show:

CB robot October 7, 2022 at 8:53 AM

Build couchbase-server-7.2.0-5000 contains couchdb commit 27d1470 with commit message:
https://couchbasecloud.atlassian.net/browse/MB-50383#icft=MB-50383: Merge remote-tracking branch 'couchbase/unstable' into HEAD

Sujay Gad March 22, 2022 at 6:29 AM

Issue not observed with longevity run on 7.1.0-2506 (RC2). Hence closing this ticket.

CB robot March 16, 2022 at 12:25 AM

Build couchbase-server-7.2.0-1016 contains couchdb commit 0dc30ae with commit message:
https://couchbasecloud.atlassian.net/browse/MB-50383#icft=MB-50383: Check log files presence for compact done call

CB robot March 15, 2022 at 9:17 AM

Build couchbase-server-7.1.0-2483 contains couchdb commit 0dc30ae with commit message:
https://couchbasecloud.atlassian.net/browse/MB-50383#icft=MB-50383: Check log files presence for compact done call

CB robot March 15, 2022 at 9:17 AM

Build couchbase-server-7.1.0-2483 contains couchdb commit 27d1470 with commit message:
https://couchbasecloud.atlassian.net/browse/MB-50383#icft=MB-50383: Merge remote-tracking branch 'couchbase/unstable' into HEAD

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Is this a Regression?

Unknown

Triage

Triaged

Due date

Story Points

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created January 13, 2022 at 10:27 AM
Updated October 7, 2022 at 8:53 AM
Resolved March 15, 2022 at 7:24 AM
Instabug