View Queries not returning all results

Couchbase 3.0 running on linux.

For some reason, sometimes the view queries that are set up on one of my buckets are not returning on all results. There are thousands of documents in the bucket, none of my views return more than 20 documents.

I’m not sure of when the issue started occurring, I’m thinking that the bucket is reaching some type of threshold when indexing. If I flush the bucket and restore data from a backup it works fine, but then if I start adding more documents the issue comes back. If I delete a handful of documents then it goes away again.

There are about 21k documents in the bucket, none are relatively big and it doesn’t look like the bucket is using up all of the resources given to it:

RAM is currently sitting at 47MB of 2GB.
Disk Usage is only 23.1MB

I’m seeing this issue on two different buckets (one is a copy of the other) on two different servers with relatively similar setups.

are you issuing the queries with stale=false flag or another staleness option?

Yes. I’m using stale=false.

is this sporadic or are you consistently seeing missing data once the issue starts happening?

It’s consistent. After it starts happening it doesn’t go away, unless I delete a few documents.

An update, for anyone who might be experiencing this same issue:

My problem was that in most cases I was using the dev views instead of publishing and using production ones. Publishing and switching fixed the issue.

(facepalm)