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

backup query solution for cached plans is leaked in get_executor.cpp

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.7.4
    • Fix Version/s: 2.7.5
    • Component/s: Querying
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Run the following and check for increasing memory usage using a tool such as "top":

      t.drop();
      t.ensureIndex({a: 1});
      t.ensureIndex({b: 1});
      for (var i = 0; i < 20; i++) { t.insert({b: i}); }
      for (var i = 0; i < 20; i++) { t.find({b: 1}).sort({a: 1}).next(); }

      Show
      Run the following and check for increasing memory usage using a tool such as "top": t.drop(); t.ensureIndex({a: 1}); t.ensureIndex({b: 1}); for (var i = 0; i < 20; i++) { t.insert({b: i}); } for (var i = 0; i < 20; i++) { t.find({b: 1}).sort({a: 1}).next(); }

      Description

      A memory leak was introduced in 2.7 versions as part of the refactor from the CachedPlanRunner to the CachedPlanStage. The code linked below calls QueryPlanner::planFromCache(), but fails to cleanup the backup query solution:

      https://github.com/mongodb/mongo/blob/2ea074937c82239d7ae187af879f0352131b119b/src/mongo/db/query/get_executor.cpp#L267-L295

        Attachments

          Activity

            People

            Assignee:
            david.storch David Storch
            Reporter:
            david.storch David Storch
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: