When running the mapreduce.shardedfinish command against a mongod with majority reads enabled, it's possible to deadlock. This is because we take a global lock here, then use DBDirectClient to run a count(), which in turn will use AutoGetCollectionForRead to take database locks which in turn calls ReplicationCoordinatorImpl::waitUntilSnapshotCommitted. AugoGetCollectionForRead attempts to yield its locks when waiting for the snapshot, but it won't be able to yield the global lock held by the map reduce code above where it called into DBDirectClient.
- related to
-
SERVER-27097 Coverity analysis defect 100050: Dereference null return value
- Closed