-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework, Querying
-
None
-
Fully Compatible
-
ALL
-
Query 11 (03/14/16), Query 2016-11-21, Query 2016-12-12, Query 2017-02-13, Query 2017-03-27
-
15
Plan executors that own a PipelineProxyStage do not hold a collection lock while they are being iterated. However, all executors that are eligible for kill notifications must hold a lock while they are being iterated, as concurrent access to PlanExecutor::_killReason for registered PlanExecutor objects is protected by the collection lock.
As a result, if a plan executor owning a PipelineProxyStage executor is killed during execution, then the executor's call to read _killReason from PlanExecutor::killed() will race with the killing thread's call to write _killReason from PlanExecutor::kill(). This is undefined behavior, and potentially can result in a server crash.
Aggregation cursors and plan executors should be owned by the global cursor manager, instead of by the collection's cursor manager. This correctly captures the fact that the lifetime of an aggregation cursor/executor is not tied to the lifetime of the collection, and this will prevent these cursors/executors from receiving kill notifications.
The underlying plan executor owned by DocumentSourceCursor should remain owned by the associated collection's cursor manager, and should be registered for receiving invalidations and kill notifications.
- is depended on by
-
SERVER-26608 $out can attempt to upgrade locks if an error is encountered during a getMore
- Closed
- is duplicated by
-
SERVER-24704 Stats for aggregation overcounted in Top
- Closed
- is related to
-
SERVER-25005 Execute queries in $lookup and $graphLookup with an explicit Pipeline instead of DBDirectClient
- Closed
-
SERVER-23294 DocumentSourceMergeCursors should be namespace-agnostic for merged cursors
- Closed
-
SERVER-29354 add ability to atomically replace view definition
- Closed
- related to
-
SERVER-17624 Interrupting aggregation operation can trip fatal assertion
- Closed
-
SERVER-27253 $lookup and $graphLookup do not increment index stats counters
- Closed
-
SERVER-27414 On mongos, cannot query view whose first stage is $collStats and is backed by another view
- Closed
-
SERVER-33959 CursorManager attempts to dispose of aggregation cursors while holding partitioned lock, which leads to deadlock
- Closed
-
SERVER-26037 DocumentSourceCursor should report appropriate error on encountering a view
- Backlog
-
SERVER-55034 The profile command should not take S or X database locks
- Closed