[SERVER-59204] unowned filter BSONObj stored in PlanCache entry debugInfo Created: 09/Aug/21  Updated: 29/Oct/23  Resolved: 16/Aug/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.1.0, 5.0.2
Fix Version/s: 5.0.3, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: James Wahlin
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-53060 Remove QueryRequest class Closed
related to SERVER-59841 Consider whether ownership should be ... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: QO 2021-08-23
Participants:
Linked BF Score: 148

 Description   

The PlanCache currently stores BSONObj owned by the FindCommandRequest in debugInfo entries. In the case that the FindCommandRequest was built Once cached, these entries can outlive the original request and the debugInfo filter and sort will point to unowned memory. Both should be made owned as part of populating the debugInfo.

This only exists in 5.0 and master only as it was introduced recently with a change to use IDL to parse the find command.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by James Wahlin [ 08/Sep/21 ]

We decided that the fix committed above is the correct one in light of IDL ownership semantics which don't guarantee that fields of "owned" types are always owned. I filed SERVER-59841 to track potential improvements to the IDL in regards to enforcing ownership.

Comment by Githook User [ 12/Aug/21 ]

Author:

{'name': 'James Wahlin', 'email': 'james@mongodb.com', 'username': 'jameswahlin'}

Message: SERVER-59204 Ensure that BSONObj stored in the PlanCacheEntry debugInfo is owned

(cherry picked from commit fce8274e6d47ed28d915e8e2db5149876dbcae25)
Branch: v5.0
https://github.com/mongodb/mongo/commit/19ffa7cd17fa828c43cac69b572588dc84208055

Comment by Githook User [ 12/Aug/21 ]

Author:

{'name': 'James Wahlin', 'email': 'james@mongodb.com', 'username': 'jameswahlin'}

Message: SERVER-59204 Ensure that BSONObj stored in the PlanCacheEntry debugInfo is owned
Branch: master
https://github.com/mongodb/mongo/commit/fce8274e6d47ed28d915e8e2db5149876dbcae25

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