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

Abandoned cursor in a transaction can block other operations

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Critical - P2 Critical - P2
    • None
    • 4.0.0-rc0
    • Concurrency, Querying
    • None
    • Replication
    • ALL
    • 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

        Activity

          People

            backlog-server-repl Backlog - Replication Team
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            19 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: