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

Deadlock waiting for majority snapshot during map reduce output stage

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.4.0-rc4
    • MapReduce
    • None
    • Fully Compatible
    • ALL
    • Query 17 (07/15/16), Query 2016-11-21
    • 0

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: