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

AsyncRequestsMerger won't attempt to cleanup shard cursors when deadline is exceeded

    • Fully Compatible
    • ALL
    • Show
      repro-server-62710.patch
    • QE 2022-02-21, QE 2022-03-07, QE 2022-03-21

      In a sharded cluster, when the client performs a find, mongos will open a set of cursors on the shards and pass them to RouterStageMerge. When the mongos is done with the cursors (exhausted, errored, etc.) RouterStageMerge:kill will get invoked, which will end up calling AsyncResultsMerger::kill. There, _scheduleKillCursors will attempt to invoke killCursors onto the shards.

      This is a best-effort – we ignore any failures. However, in the the event of a MaxTimeMSExpired failure, because in the mongos the opCtx deadline is also expired, this best-effort killCursors won't even get scheduled because the executor will immediately timeout when attempting to get a connection from the pool. This will leak the shard cursors.

      Attached repro script.

        1. repro-server-62710.patch
          1 kB
          Jordi Serra Torrens

            Assignee:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'slack.nextup.jira:slack-integration-plus'. Please contact your Jira administrators.