void ReplicationCoordinatorExternalStateImpl::startSteadyStateReplication() {
    if (!_producerThread) {
        log() << "Starting replication fetcher thread";
        _bgSync.reset(new BackgroundSync(makeSteadyStateOplogBuffer()));
        _producerThread.reset(
            new stdx::thread(stdx::bind(&BackgroundSync::producerThread, _bgSync.get(), this)));
    }
    log() << "Starting replication applier threads";
    invariant(!_applierThread);
    _applierThread.reset(new stdx::thread(stdx::bind(&runSyncThread, _bgSync.get())));
    log() << "Starting replication reporter thread";
    invariant(!_syncSourceFeedbackThread);
    _syncSourceFeedbackThread.reset(new stdx::thread(
        stdx::bind(&SyncSourceFeedback::run, &_syncSourceFeedback, _bgSync.get())));
}
void ReplicationCoordinatorExternalStateImpl::startSteadyStateReplication(OperationContext* txn) {
    invariant(!_bgSync);
    log() << "Starting replication fetcher thread";
    _bgSync = stdx::make_unique<BackgroundSync>(this, makeSteadyStateOplogBuffer(txn));
    _bgSync->startup(txn);

    log() << "Starting replication applier threads";
    invariant(!_applierThread);
    _applierThread.reset(new RSDataSync{_bgSync.get(), ReplicationCoordinator::get(txn)});
    _applierThread->startup();
    log() << "Starting replication reporter thread";
    invariant(!_syncSourceFeedbackThread);
    _syncSourceFeedbackThread.reset(new stdx::thread(stdx::bind(
        &SyncSourceFeedback::run, &_syncSourceFeedback, _taskExecutor.get(), _bgSync.get())));
}