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

Committing a transaction which was started with a killCursors command can fail

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.6
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Repl 2018-11-19
    • Linked BF Score:
      4

      Description

      AsyncResultsMerger::blockingKill() sends a killCursors command to each of its remotes. However, it discards the callback handle for the request, so blockingKill() can return before the killCursors command reaches the remote. This means that if the client issues a killCursors command, and then a commitTransaction command, a shard can receive the commitTransaction before the killCursors. This is problematic in combination with transactions. Consider the following sequence of events:

      • User starts transaction 0 with killCursors sent to mongos.
      • User receives ok response.
      • User sends commitTransaction for transaction 0 to mongos.
      • mongod receives commitTransaction, which fails since transaction 0 does not yet exist.
      • mongod receives killCursors, which starts transaction 0.

      Now the mongod is stuck with transaction 0 open.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              samy.lanka Samyukta Lanka
              Reporter:
              tess.avitabile Tess Avitabile
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: