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

Relax mutex locks in FIleCopyBasedInitialSyncer

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.2.0
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • Replication 2021-11-15

    Description

      Member variables in FileCopyBasedInitialSyncer may be accessed without a lock from within the main flow of control (regardless of the underlying executor thread), if they are only accessed from the main flow of control (should be annotated (X)). We have been locking more than that, which results in a deadlock when switching storage.

      In particular, the class mutex should not be held while a database lock (i.e. global X) is held, regardless of order. This is because mutexes are not interruptible, so if a thread with an opCtx and no database locks blocks on the mutex, and we attempt to interrupt that opCtx as part of the storage change, there is a deadlock.

      Attachments

        Activity

          People

            matthew.russotto@mongodb.com Matthew Russotto
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: