Recently I’ve stumbled on an interesting issue with indexing in Couchbase. I’m running an integration test which adds 5 documents to Couchbase and triggers some service which retrieves them by using N1QL queries. Most of the time the test passes, but fails after a couple dozens of test runs because it can’t find some of the documents.
I’ve examined the database after the test failure. It turns out that sometimes, some documents do not get indexed, even after a very long time, like 30 minutes (I’m able to retrieve documents by ID but not by
SELECT * FROM bucket).
I’m using couchbase community docker container with default query consistency, version=4.0.0-4051 with the Java SDK, I’m not mutating any keys.
We start couchbase docker container before all the tests, then before each test we flush the bucket. Can that cause any problems? Are we guaranteed that all documents will be eventually indexed (what is the max time for 5 documents)?