Deadlock triggered by dbEval+writeCmd and replSetInitiate on single mongod

XMLWordPrintableJSON

    • Replication
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:
              [DO NOT USE] Backlog - Replication Team
              Reporter:
              Robert Guo (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: