diff options
author | William Schultz <william.schultz@mongodb.com> | 2016-11-14 17:29:02 -0500 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2016-11-15 14:42:44 -0500 |
commit | c55f35b894f145d14e7f3b4b431f4139c80a3778 (patch) | |
tree | aaa684fe63fd9c94742d882f7458c33ecf697dda /src/mongo/db | |
parent | 549c3f4315fd95431a662e7a8eff880f00b1458d (diff) | |
download | mongo-c55f35b894f145d14e7f3b4b431f4139c80a3778.tar.gz |
SERVER-26530 Add helpful log message for user when initial sync fails
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index 5a5b0cf9fce..3de98571a7c 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -610,16 +610,18 @@ void ReplicationCoordinatorImpl::_startDataReplication(OperationContext* txn, drCopy.reset(); lk.lock(); - if (ErrorCodes::CallbackCanceled == status || - ErrorCodes::ShutdownInProgress == status) { - + if (status == ErrorCodes::CallbackCanceled) { log() << "Initial Sync has been cancelled: " << status.getStatus(); return; - } else if (!_inShutdown) { - fassertNoTrace(40088, status.getStatus()); } else if (!status.isOK()) { - log() << "Initial Sync failed during shutdown due to " << status.getStatus(); - return; + if (_inShutdown) { + log() << "Initial Sync failed during shutdown due to " << status.getStatus(); + return; + } else { + error() << "Initial sync failed, shutting down now. Restart the server to " + "attempt a new initial sync."; + fassertFailedWithStatusNoTrace(40088, status.getStatus()); + } } const auto lastApplied = status.getValue(); |