summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatherine Walker <katherine.walker@mongodb.com>2017-09-21 14:11:50 -0400
committerKatherine Walker <katherine.walker@mongodb.com>2017-09-26 17:26:44 -0400
commitdb986c959a8e080d038577ae107af60bf2611557 (patch)
tree7f521a5f51923e18c2a910af2d75fc896c93a06a
parentb1e0108555a28fc3f487be642e0d3ac34ddeb794 (diff)
downloadmongo-db986c959a8e080d038577ae107af60bf2611557.tar.gz
SERVER-29649 Add startupWarning for replset running with --nojournal when writeConcernMajorityJournalDefault is not false
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index 5d8fee72e3e..9ffbed75ae3 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -2795,6 +2795,24 @@ ReplicationCoordinatorImpl::_setCurrentRSConfig_inlock(OperationContext* opCtx,
log() << "** in a future version." << startupWarningsLog;
}
+ // Warn if running --nojournal and writeConcernMajorityJournalDefault = false
+ StorageEngine* storageEngine = opCtx->getServiceContext()->getGlobalStorageEngine();
+ if (!storageEngine->isDurable() &&
+ (newConfig.getWriteConcernMajorityShouldJournal() &&
+ (!oldConfig.isInitialized() || !oldConfig.getWriteConcernMajorityShouldJournal()))) {
+ log() << startupWarningsLog;
+ log() << "** WARNING: This replica set is running without journaling enabled but the "
+ << startupWarningsLog;
+ log() << "** writeConcernMajorityJournalDefault option to the replica set config "
+ << startupWarningsLog;
+ log() << "** is set to true. The writeConcernMajorityJournalDefault "
+ << startupWarningsLog;
+ log() << "** option to the replica set config must be set to false "
+ << startupWarningsLog;
+ log() << "** or w:majority write concerns will never complete."
+ << startupWarningsLog;
+ log() << startupWarningsLog;
+ }
log() << "New replica set config in use: " << _rsConfig.toBSON() << rsLog;
_selfIndex = myIndex;