Use separate query before your test query that uses REQUEST_PLUS to guarantee the indexing is complete. That’s what I do for tests where I don’t want to use REQUEST_PLUS on the actual query.
Can a single node has stale data about this ?
9102 is the indexer node - so if there is only one node then that should have current data (and yet it apparently doesn’t). I wonder if it is possible that when the read of /api/v1/stats/myBucket._default.myCollection/myIndex occurs, that it has not yet added the document(s) to it’s queue. The kv operations don’t wait for that. If you are inserting, try checking “num_docs_indexed” before inserting and then wait until it has increased by one.
Clever. I’m gonna do that, because like you said the indexer data have some delays (understandable). Testing the num_docs_indexed is one way to workaround it, but I would have liked a method that gives me the remaining mutations in a reliable manner. I’m gonna open a ticket so they add a field last_stats_update in the response, so we can poll the data and check last_stats_update > time of the first poll. This way we make sure the stats take into account mutations done before the call.