[SERVER-19996] Queries which specify sort and batch size can generate results out of order, if documents concurrently updated Created: 17/Aug/15 Updated: 21/Dec/15 Resolved: 18/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 3.0.9, 3.1.9 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | J Rassi | Assignee: | David Storch |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Completed: | |||||||||||||
| Sprint: | Quint 9 09/18/15 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
The KeepMutationsNode query solution node is added to the incorrect place in the query solution tree for "split limited sort" plans (which are generated when a sort and a positive ntoreturn are specified). As a consequence, if the documents to be returned are concurrently updated, the KeepMutationsStage can inject these documents into the result stream out of order. Affects versions released since 2.5.5. Reproduce with the following:
Output generated:
|
| Comments |
| Comment by Githook User [ 21/Dec/15 ] |
|
Author: {u'username': u'yhjw88', u'name': u'Yunhe (John) Wang', u'email': u'yunhe.wang@mongodb.com'}Message: (cherry picked from commit e07a93a7ea6756434e0d3df38cdd1e6f5d5fd010) Conflicts: |
| Comment by Githook User [ 18/Sep/15 ] |
|
Author: {u'username': u'yhjw88', u'name': u'Yunhe (John) Wang', u'email': u'yunhe.wang@mongodb.com'}Message: |
| Comment by YunHe Wang [ 17/Sep/15 ] |
|
The reproduction actually catches the bug pointed out in |
| Comment by David Storch [ 08/Sep/15 ] |
|
This problem is due not only to the KEEP_MUTATIONS stage being misplaced in the query plan tree: it's also due to |