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

Initial sync and replication threads simultaneous startup and shutdown races

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.1, 4.3.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v4.2
    • Repl 2019-07-15, Repl 2019-07-29, Repl 2019-08-12, Repl 2019-08-26
    • 57

      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.

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

              Created:
              Updated:
              Resolved: