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

Deadlock waiting for majority snapshot during map reduce output stage

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.0-rc4
    • Affects Version/s: None
    • Component/s: MapReduce
    • None
    • Fully Compatible
    • ALL
    • Query 17 (07/15/16), Query 2016-11-21
    • 0

      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.

            Assignee:
            marko.vojvodic@mongodb.com Marko Vojvodic
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: