Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-21227

MultiPlanStage::invalidate() should not flag and drop invalidated WorkingSetMembers

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.12, 3.0.8, 3.2.0-rc3
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Completed:
    • Sprint:
      QuInt C (11/23/15)

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: