[SERVER-25694] DocumentSourceCursor should destroy its PlanExecutor while holding the collection lock Created: 18/Aug/16  Updated: 06/Dec/17  Resolved: 13/Apr/17

Status: Closed
Project: Core Server
Component/s: Aggregation Framework, Querying
Affects Version/s: 3.3.11
Fix Version/s: 3.5.6

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Charlie Swanson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-28499 StorageInterfaceImpl::_findOrDeleteDo... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2016-11-21, Query 2016-12-12, Query 2017-01-23, Query 2017-02-13, Query 2017-03-27, Query 2017-04-17
Participants:
Linked BF Score: 0

 Description   

Note: This is only an issue after the changes from SERVER-25005 because the "inner" plan executor underlying the aggregation pipeline is now registered in the collection's cursor manager.

Deregistering a PlanExecutor requires accessing the CursorManager of a Collection. We must hold a lock on the collection in order to prevent the collection from going away while deregistering the plan executor.



 Comments   
Comment by Githook User [ 13/Apr/17 ]

Author:

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

Message: SERVER-25694 Eliminate race in PlanExecutor cleanup.

Ensures that a collection lock is held in at least MODE_IS while
deregistering a PlanExecutor from the cursor manager. Introduces new
PlanExecutor::dispose() and ClientCursor::dispose() methods that must be
called before destruction of those classes, and ensures they are called
before destruction. These calls will thread an OperationContext all the
way through to DocumentSource::dispose() for each stage in a Pipeline,
which will give DocumentSourceCursor a chance to acquire locks and
deregister its PlanExecutor if necessary.
Branch: master
https://github.com/mongodb/mongo/commit/cc954e9e1d88b30d1ab89ee3bbbd9db0bb15263d

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