Select all document id from exactly x days ago?

Okay, this is definitely a bug in Couchbase server (In my case 4.1.1 and don’t know about 4.5.0). Earlier I actually kept nearly 10 million of documents in CB(4.1.1) for testing purpose. Just a week back I flushed the entire Bucket and kept only 4 document for the purpose of above testing.

Now when I run my Distinct query with a timeout of 30 seconds it throws ConcurrentTimeoutException. So I changed the query and run only Select query instead of Distinct and saw thousands/millions of expiryDay value printing in my java console.

I am doubting that the indexing is keeping a separate set of data for himself which is intact even after the data is flushed from the bucket. I wonder if it is not fixed in new version of CB. If so then this is a real threat.