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

Deadlock triggered by dbEval+writeCmd and replSetInitiate on single mongod

    • Replication
    • Fully Compatible
    • ALL

      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

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: