[SERVER-21277] Deadlock triggered by dbEval+writeCmd and replSetInitiate on single mongod Created: 04/Nov/15  Updated: 06/Dec/22  Resolved: 31/May/16

Status: Closed
Project: Core Server
Component/s: Querying, Replication
Affects Version/s: 3.2.0-rc1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Robert Guo (Inactive) Assignee: Backlog - Replication Team
Resolution: Done Votes: 0
Labels: fuzzer-blacklist, fuzzer-blocker
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-23698 Remove ability to run replSetInitiate... Closed
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 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



 Comments   
Comment by Robert Guo (Inactive) [ 31/May/16 ]

Closing this issue as "gone away" as it is no longer possible to call rs.initiate() on a standalone mongod after SERVER-23698.

Comment by Kamran K. [ 31/May/16 ]

judah.schvimer / robert.guo, is this bug still possible after fixing SERVER-23698?

Comment by Eric Milkie [ 04/Nov/15 ]

I put this in Planning Bucket A, since it isn't possible to actually do writes successfully (except to local db) on a replSet node that hasn't been initiated yet. This, coupled with waning use of eval, lowers the priority of this ticket. Please comment if you believe otherwise.

Generated at Thu Feb 08 03:56:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.