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

Abandoned cursor in a transaction can block other operations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Works as Designed
    • Affects Version/s: 4.0.0-rc0
    • Fix Version/s: None
    • Component/s: Concurrency, Querying
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Download the attached 'repro.js', then run:

      python buildscripts/resmoke.py --suites=replica_sets_jscore_passthrough repro.js

      That will hang forever.

      Show
      Download the attached 'repro.js', then run: python buildscripts/resmoke.py --suites=replica_sets_jscore_passthrough repro.js That will hang forever.

      Description

      Suppose a transaction opens a cursor, then abandons it. The locks for that cursor will be held in intent mode, even between batches.

      Now suppose a drop for the database or collection comes in. That drop will "get in line" with a MODE_X lock. In order to be fair to such requests, that pending MODE_X acquisition will block all future intent acquisitions. 

      This will prevent a killCursors from killing the cursor, since it will need to take a collection lock. It looks like it will also prevent the background transaction timeout job from killing it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-repl Backlog - Replication Team
              Reporter:
              charlie.swanson Charlie Swanson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              19 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: