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.
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