Can documents returned during fetch phase have changed since query phase

Our system assumes the documents returned by a search actually satisfy the query. Is it possible that, if a document is modified between the query and fetch phases of a search that the returned document doesn’t actually satisfy the query?

It'd be a bug if it happened. The query phase pins a snapshot of documents that is re-used by the fetch phase. Even if the document is modified between the fetch and query phase you should get back the "old" version of the document. Same for deletes - you'll get back the deleted document. Think of it as a very limited, shard focused version of "repeatable read".

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.