[SERVER-21227] MultiPlanStage::invalidate() should not flag and drop invalidated WorkingSetMembers Created: 30/Oct/15  Updated: 17/Nov/15  Resolved: 05/Nov/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 2.6.12, 3.0.8, 3.2.0-rc3

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-20299 Delete KEEP_MUTATIONS stage Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: QuInt C (11/23/15)
Participants:

 Description   

If a result document buffered inside the MultiPlanStage is invalidated by an update or delete during a yield, this result is dropped from the result set and flagged for review by the KeepMutationsStage:

https://github.com/mongodb/mongo/blob/cbc6a790dc4ac537b071626dff77d0073512690c/src/mongo/db/exec/multi_plan.cpp#L432-L433

However, KeepMutationsStage is always below MultiPlanStage in the query execution tree, which means that the flagged results will never get revisited. As a result, these documents will be absent from the result set.

In general, concurrently modified results may be dropped from the query result set (see the Concurrency FAQ). However, the system should make a best effort to preserve results. We could do better in this case by simply copying the pre-image of the about-to-be modified document rather than dropping it.



 Comments   
Comment by Githook User [ 06/Nov/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-21227 don't drop invalidated results in the MultiPlanRunner
Branch: v2.6
https://github.com/mongodb/mongo/commit/3bd1d8bb96dae6c780ea451cc1dc60794188a69b

Comment by Githook User [ 06/Nov/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-21227 don't drop invalidated results in MultiPlanStage or CachedPlanStage

(cherry picked from commit e70c8cb86571dba41fda10e26a46274fe4d66591)

Conflicts:
src/mongo/db/exec/cached_plan.cpp
Branch: v3.0
https://github.com/mongodb/mongo/commit/e81c8bce740deea291cbcb7f4c0652d0ae6af25e

Comment by Githook User [ 05/Nov/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-21227 don't drop invalidated results in MultiPlanStage or CachedPlanStage
Branch: master
https://github.com/mongodb/mongo/commit/e70c8cb86571dba41fda10e26a46274fe4d66591

Generated at Thu Feb 08 03:56:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.