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

replSetSyncFrom can cause deadlock between ReplicationCoordinator and InitialSyncer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Gone away
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Replication
    • Labels:
    • Operating System:
      ALL
    • Sprint:
      Repl 2018-07-02

      Description

      The InitialSync::_fcvFetcherCallback function acquires the InitialSync mutex and then acquires the ReplicationCoordinator mutex. This ordering is inconsistent with some functions in ReplicationCoordinator e.g. ReplicationCoordinatorImpl::processReplSetSyncFrom and ReplicationCoordinatorImpl::processReplSetGetStatus. At the time of writing this, the ReplicationCoordinator mutex acquisition was elimiinated in processReplSetGetStatus by SERVER-34758. The potential deadlock with processReplSetSyncFrom is mostly addressed already in SERVER-28840.

      -------------------------

      Original Coverity Description:

      Threads may try to acquire two locks in different orders, potentially causing deadlock

      Defect 103597 (STATIC_C)
      Checker ORDER_REVERSAL (subcategory none)
      File: /src/mongo/db/repl/initial_syncer.cpp
      Function mongo::repl::InitialSyncer::_fcvFetcherCallback(const mongo::StatusWith<mongo::Fetcher::QueryResponse> &, std::shared_ptr<mongo::repl::CallbackCompletionGuard<mongo::StatusWith<mongo::repl::OpTimeWith<long long>>>>, const mongo::repl::OpTimeWith<long long> &)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: