[SERVER-14753] backup query solution for cached plans is leaked in get_executor.cpp Created: 31/Jul/14  Updated: 14/Nov/14  Resolved: 01/Aug/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.7.4
Fix Version/s: 2.7.5

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: cap-ticket-needed
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Tested
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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(); }

Participants:

 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



 Comments   
Comment by Githook User [ 02/Nov/14 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-14747 SERVER-14753 Add validation tests for memory leak fixes
Branch: master
https://github.com/mongodb/mongo/commit/9eb7ba71ac9f3d056b7b1f41e384a9bb732078c0

Comment by Githook User [ 01/Aug/14 ]

Author:

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

Message: SERVER-14753 fix leak of backup query solution
Branch: master
https://github.com/mongodb/mongo/commit/f76e04154f73286fc1ce4a023116faa4170bcfdf

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