diff options
author | Vishnu Kaushik <vishnu.kaushik@mongodb.com> | 2019-05-31 10:21:00 -0400 |
---|---|---|
committer | Vishnu Kaushik <vishnu.kaushik@mongodb.com> | 2019-05-31 12:29:17 -0400 |
commit | 1ae9c35e4b8ae754fe49075f7f729bccb256e7d0 (patch) | |
tree | 7eaef811ab0b7328d2b6a9c0c22af140a68bb093 | |
parent | bd5db0ba92a47a902894890e46e45dbf5d73ba09 (diff) | |
download | mongo-1ae9c35e4b8ae754fe49075f7f729bccb256e7d0.tar.gz |
SERVER-38685 Adds a warning when ephemeral storage is used with writeConcernMajorityJournalDefault = true
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index 87bed913f8a..63c70628dd5 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -3122,7 +3122,7 @@ ReplicationCoordinatorImpl::_setCurrentRSConfig(WithLock lk, _rsConfig = newConfig; _protVersion.store(_rsConfig.getProtocolVersion()); - // Warn if running --nojournal and writeConcernMajorityJournalDefault = false + // Warn if running --nojournal and writeConcernMajorityJournalDefault = true StorageEngine* storageEngine = opCtx->getServiceContext()->getStorageEngine(); if (storageEngine && !storageEngine->isDurable() && (newConfig.getWriteConcernMajorityShouldJournal() && @@ -3141,6 +3141,24 @@ ReplicationCoordinatorImpl::_setCurrentRSConfig(WithLock lk, log() << startupWarningsLog; } + // Warn if using the in-memory (ephemeral) storage engine with + // writeConcernMajorityJournalDefault = true + if (storageEngine && storageEngine->isEphemeral() && + (newConfig.getWriteConcernMajorityShouldJournal() && + (!oldConfig.isInitialized() || !oldConfig.getWriteConcernMajorityShouldJournal()))) { + log() << startupWarningsLog; + log() << "** WARNING: This replica set is using in-memory (ephemeral) storage with the " + << startupWarningsLog; + log() << "** writeConcernMajorityJournalDefault option to the replica set config " + << startupWarningsLog; + log() << "** set to true. The writeConcernMajorityJournalDefault option to the " + << startupWarningsLog; + log() << "** replica set config is unsupported while using in-memory storage." + << startupWarningsLog; + log() << startupWarningsLog; + } + + log() << "New replica set config in use: " << _rsConfig.toBSON() << rsLog; _selfIndex = myIndex; if (_selfIndex >= 0) { |