[SERVER-35455] QueryPlannerAccess should hold owned pointers by unique_ptr rather than raw pointer Created: 06/Jun/18  Updated: 29/Oct/23  Resolved: 12/Jun/18

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.4.19, 3.6.10, 4.0.6, 4.1.1

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

Issue Links:
Backports
Depends
Related
related to SERVER-35512 QuerySolutionNode should hold its chi... Closed
related to SERVER-35515 MatchExpression trees should hold chi... Closed
is related to SERVER-38601 Add regression test for memory leak d... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0, v3.6, v3.4
Sprint: Query 2018-06-18
Participants:
Case:
Linked BF Score: 15

 Description   

planner_access.cpp has quite a few uses of owned raw pointers which need to be cleaned up. This code is not exception safe, and our testing infrastructure has proven that it can leak memory in obscure error cases. Furthermore, implementation errors in the planner that would lead to query-fatal exceptions have the additional adverse consequence of leaking memory. Finally, fixing this will make it easier to move towards having the planner propagate errors by exception instead of Status.



 Comments   
Comment by Githook User [ 20/Dec/18 ]

Author:

{'username': 'cswanson310', 'email': 'charlie.swanson@mongodb.com', 'name': 'Charlie Swanson'}

Message: SERVER-38601 Add regression test for SERVER-35455

(cherry picked from commit 5b736830826eca2cc36f4c6e2ebbcaf524e9c5e0)
Branch: v4.0
https://github.com/mongodb/mongo/commit/84d5a90f500bdf851bcdaa43a21435411c78975b

Comment by Githook User [ 20/Dec/18 ]

Author:

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

Message: SERVER-35455 Eliminate owned raw pointers from QueryPlannerAccess.

This fixes a previous version of this commit by adding
std::move() where copy elision is not guaranteed.

(cherry picked from commit 1d89d2c88bcb39045701b87612b866ae2eb49378)
Branch: v4.0
https://github.com/mongodb/mongo/commit/12f9baf53a52e11a861386db5e39d884394d4b37

Comment by Githook User [ 20/Dec/18 ]

Author:

{'username': 'cswanson310', 'email': 'charlie.swanson@mongodb.com', 'name': 'Charlie Swanson'}

Message: Targeted fix for reproduction script for SERVER-38601

The patch for SERVER-35455 did not apply cleanly to this branch so
instead we pursued this more targeted fix for the leak described in
SERVER-38601.
Branch: v3.4
https://github.com/mongodb/mongo/commit/63a529c95e65197227c158667b520ee9777024c5

Comment by Githook User [ 20/Dec/18 ]

Author:

{'username': 'cswanson310', 'email': 'charlie.swanson@mongodb.com', 'name': 'Charlie Swanson'}

Message: SERVER-38601 Add regression test for SERVER-35455

(cherry picked from commit 5b736830826eca2cc36f4c6e2ebbcaf524e9c5e0)
(cherry picked from commit 8b4693170a7e5f640057a8532a9f92753ff3fb99)
(cherry picked from commit e4a68bba3602f5e295d6e2949cc4db749e752d27)
Branch: v3.4
https://github.com/mongodb/mongo/commit/ef51ce0672dde933164fba1fc4f7ecf53c77b378

Comment by Githook User [ 18/Dec/18 ]

Author:

{'username': 'cswanson310', 'email': 'charlie.swanson@mongodb.com', 'name': 'Charlie Swanson'}

Message: SERVER-38601 Add regression test for SERVER-35455

(cherry picked from commit 5b736830826eca2cc36f4c6e2ebbcaf524e9c5e0)
(cherry picked from commit 8b4693170a7e5f640057a8532a9f92753ff3fb99)
(cherry picked from commit e4a68bba3602f5e295d6e2949cc4db749e752d27)
Branch: v3.6
https://github.com/mongodb/mongo/commit/67dab95118ab0d92908ff413d8667277298b1ba2

Comment by Githook User [ 18/Dec/18 ]

Author:

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

Message: SERVER-35455 Eliminate owned raw pointers from QueryPlannerAccess.

This fixes a previous version of this commit by adding
std::move() where copy elision is not guaranteed.

(cherry picked from commit 1d89d2c88bcb39045701b87612b866ae2eb49378)
Branch: v3.6
https://github.com/mongodb/mongo/commit/1920ca38d0b302730c8220d44fd9f5fbf1f85432

Comment by Githook User [ 14/Dec/18 ]

Author:

{'username': 'cswanson310', 'email': 'charlie.swanson@mongodb.com', 'name': 'Charlie Swanson'}

Message: SERVER-38601 Add regression test for SERVER-35455
Branch: master
https://github.com/mongodb/mongo/commit/3c20ed9fae8695f105c1068524997b92638ab58a

Comment by Githook User [ 12/Jun/18 ]

Author:

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

Message: SERVER-35455 Eliminate owned raw pointers from QueryPlannerAccess.

This fixes a previous version of this commit by adding
std::move() where copy elision is not guaranteed.
Branch: master
https://github.com/mongodb/mongo/commit/1d89d2c88bcb39045701b87612b866ae2eb49378

Comment by Githook User [ 12/Jun/18 ]

Author:

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

Message: Revert "SERVER-35455 Eliminate owned raw pointers from QueryPlannerAccess."

This reverts commit dd1a525f1d1b9e3cf8f902d6c04a17607d565dea.
Branch: master
https://github.com/mongodb/mongo/commit/3215980c2500010c47da2dad0410c291e7854fa8

Comment by Githook User [ 11/Jun/18 ]

Author:

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

Message: SERVER-35455 Eliminate owned raw pointers from QueryPlannerAccess.
Branch: master
https://github.com/mongodb/mongo/commit/dd1a525f1d1b9e3cf8f902d6c04a17607d565dea

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