Description
This behavior is only observable in MMAPV1 storage engine
Desired Behavior
If an indexed query runs while documents are updated, which moves them, it is possible for those documents to be missing from the results when using MMAPV1 storage engine. We would like this behavior to change so that all matching documents which exist through the lifetime of the query are returned, even if they are updated. In particular we only expect this behavior when those updated documents have values updates in the query which aren't changed, so the query matches the document in all updated states.
Example
See code below
- Add a large document, followed by 5 small documents all with {letter: "a"}
- Add an index on {letter: 1}
- Remove the large document
- Start a query, batch size 2, using index
- Update 3rd document to cause it to move to empty space left by large, removed document.
Technical Details
When a query walks an index in MMAPV1 it is possible for documents to move behind the current position as document location is stored in the index in MMAPV1 as the cursor moves forward resulting in documents being "missed".
This behavior cannot be reproduced in WiredTiger, inMemory or encrypted storage engines.
- is related to
-
SERVER-17174 Updates can fail to find document during high concurrency
- Closed
-
SERVER-13992 UpdateTicket should handle record moves
- Closed
- related to
-
SERVER-700 Overwrite index key rather than delete/reinsert if new value would end up in the same place
- Closed
-
SERVER-14703 Snapshot queries can miss records if there are concurrent updates
- Closed