-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework, Querying
-
None
-
Fully Compatible
-
v3.6
-
Query 2017-12-04
-
0
DocumentSourceCloseCursor is part of the internal $changeStream machinery. It is used to close change stream cursors that have been invalidated, due to an event such as a collection drop or database drop.
DocumentSourceCloseCursor should always run on the mongos in the case that the $changeStream is run in a sharded configuration. This is because the mongos cursor manager is not prepared to correctly handle its child cursor being closed out from under it. Instead, the cursor should be closed via the DocumentSourceCloseCursor running on mongos. Cleanup of the mongos cursor should cause the underlying cursors on the shards to be cleaned up as well.
As of commit d4a526fdcf under SERVER-30834, $changeStream will never pass through completely to the shards. Therefore, the DocumentSourceCloseCursor should always end up on mongos. Since it is not obviously wrong to pass through the change stream, we should add an invariant to make sure that this doesn't regress.
- is related to
-
SERVER-30834 Make mongos reload the shard registry and re-establish changeStream cursors when encountering a 'retryNeeded' entry
- Closed
-
SERVER-63020 Investigate relevance of SERVER-31978 to per shard cursors
- Closed