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

Initial sync and replication threads simultaneous startup and shutdown races

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.1, 4.3.1
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2
    • Sprint:
      Repl 2019-07-15, Repl 2019-07-29, Repl 2019-08-12, Repl 2019-08-26
    • Linked BF Score:
      57

      Description

      If a mongod is shut down while it is still starting up (but after its config state is set to steady state), there are at least two races

      1) The initial syncer may be created after we would have shut it down. This can be fixed by checking for _inShutdown in the critical section in _startDataReplication where we create the initial syncer; if it is set we should not create the initial syncer.

      2) The data replication threads in ReplicationCoordinatorExternalStateImpl may be started after shutdown is called. This can be fixed by both setting _inShutdown to true even if _startedThreads is false in ReplicationCoordinatorExternalStateImpl::shutdown(), and also checking _inShutdown in ReplicationCoordinatorExternalStateImpl::startThreads.

        Attachments

          Activity

            People

            Assignee:
            matthew.russotto Matthew Russotto
            Reporter:
            matthew.russotto Matthew Russotto
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: