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

Deadlock triggered by dbEval+writeCmd and replSetInitiate on single mongod

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      There's a potential deadlock with the global lock and the replication lock.

      dbEval grabs the Global lock first:
      https://github.com/mongodb/mongo/blob/master/src/mongo/db/dbeval.cpp#L185

      then the replication lock in the writeCmd called from extractWriteConcern:
      https://github.com/mongodb/mongo/blob/master/src/mongo/db/repl/replication_coordinator_impl.cpp#L2604

      replSetInitiate grabs the replication lock first:
      https://github.com/mongodb/mongo/blob/master/src/mongo/db/repl/replication_coordinator_impl.cpp#L2094

      then the global lock around here:
      https://github.com/mongodb/mongo/blob/master/src/mongo/db/db_raii.cpp#L50

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: