CB CE v5.0.0
Java SDK: 2.5.2
Cluster: 3 Nodes (index, data, query on all nodes)
We have a feeling that our application did not recognize a recreated GSI index. After app-restart it worked fine.
What we did:
We have dropped and created (corrected) a GSI index in Couchbase Console while the application was still running.
The reason was, that for one field which was used in a N1QL query, there was no index found (because of a typo in the index definition). Thus another index was used which basically performed a Full table scan to find.
We drop and added the index again (same indexname, but small change in fields of the index definition). and ran the query again.
Here is what happened:
1.) In CB Console, the query was running fine and EXPLAIN was showing that the correct index was used.
2.) our application was still slow and seemed to not use the new index (we could see a huge spike of Ops/s in CB console because of the Full table scan).
We then restarted the application.
Suddenly it was fast as expected.
Is the Java SDK caching index information?
If yes, how long? Can this cache be cleared?
Or are we using Couchbase Environment wrong?
Currently to access CB we have a Singleton CouchbaseDAO which holds a single ref to DefaultCouchbaseEnvironment, Cluster and Bucket.
Any hints appreciated.