Immediate fetch after an upsert fails

I’m using Java SDK’s query() method to issue an upsert query. The query succeeds but when I try to fetch the upserted documents immediately after this, I get an empty list.

It seems like the documents aren’t available for a brief period of time (a couple of seconds, usually), after which fetch works fine.

Does anyone know why this is happening?

Edit: I’m using a single node 7.2 server

1 Like

While the kv insert is instantaneous, (an immediate kv get will find the document) indexing for query is not. To allow the query to scan indexes of documents inserted up until the time of the query request, use the query option QueryScanConsistency.REQUEST_PLUS

2 Likes