-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Fully Compatible
-
Service Arch 2022-09-19, Service Arch 2022-10-03
TaskExecutorCursor can issue queries that the remote can respond to with multiple cursors. In such cases, we use the TaskExecutorCursor that issued the query to handle the first cursor, and create new TaskExecutorCursors for each additional cursor in the response using this constructor here .
We rely on our processing of the first cursor to update the _rcr we pass into the constructor with the 'new' opCtx https://github.com/mongodb/mongo/blob/790dde10c5f653c65b394cf397e96d099e2f5d03/src/mongo/executor/task_executor_cursor.cpp#L162 - but if the first cursor id is 0 / there is no more additional data in it, we'll skip doing that population here https://github.com/mongodb/mongo/blob/790dde10c5f653c65b394cf397e96d099e2f5d03/src/mongo/executor/task_executor_cursor.cpp#L210. As a result, the _rcr we pass to construct the additional TECs can have a 'stale' opCtx in it - the one that was originally used to issue the first query - which may be destroyed when these constructors are called.