Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-69702

TaskExecutorCursor can fail to populate _rcr with updated opCtx if multiple cursors returned

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • 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.

            Assignee:
            george.wangensteen@mongodb.com George Wangensteen
            Reporter:
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: