summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Noma <gregory.noma@gmail.com>2020-10-20 18:34:17 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-20 23:15:36 +0000
commit8d91cd9f7887b3b2c44243b6230e676f32fb37a2 (patch)
treebb7661bdfda62af28285055690c754099a8c231e
parente8c373424c6bd0460198b9a94936369e0a83b6f5 (diff)
downloadmongo-8d91cd9f7887b3b2c44243b6230e676f32fb37a2.tar.gz
SERVER-45992 Skip nojournal warning when starting up with inMemory storage engine and writeConcernMajorityJournalDefault=true
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp83
1 files changed, 43 insertions, 40 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index a5753199a6b..4f706aa7dc1 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -3276,47 +3276,50 @@ ReplicationCoordinatorImpl::_setCurrentRSConfig(WithLock lk,
_rsConfig = newConfig;
_protVersion.store(_rsConfig.getProtocolVersion());
- // Warn if running --nojournal and writeConcernMajorityJournalDefault = true
+ // Warn if using the in-memory (ephemeral) storage engine or running running --nojournal with
+ // writeConcernMajorityJournalDefault=true.
StorageEngine* storageEngine = opCtx->getServiceContext()->getStorageEngine();
- if (storageEngine && !storageEngine->isDurable() &&
- (newConfig.getWriteConcernMajorityShouldJournal() &&
- (!oldConfig.isInitialized() || !oldConfig.getWriteConcernMajorityShouldJournal()))) {
- log() << startupWarningsLog;
- log() << "** WARNING: This replica set node 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() << "** In addition, this node's memory consumption may increase until all"
- << startupWarningsLog;
- log() << "** available free RAM is exhausted." << startupWarningsLog;
- 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 node 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 must be set to false " << startupWarningsLog;
- log() << "** or w:majority write concerns will never complete."
- << startupWarningsLog;
- log() << "** In addition, this node's memory consumption may increase until all"
- << startupWarningsLog;
- log() << "** available free RAM is exhausted." << startupWarningsLog;
- log() << startupWarningsLog;
+ if (storageEngine && newConfig.getWriteConcernMajorityShouldJournal() &&
+ (!oldConfig.isInitialized() || !oldConfig.getWriteConcernMajorityShouldJournal())) {
+ if (storageEngine->isEphemeral()) {
+ log() << startupWarningsLog;
+ log() << "** WARNING: This replica set node 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 must be set to false " << startupWarningsLog;
+ log() << "** or w:majority write concerns will never complete."
+ << startupWarningsLog;
+ log()
+ << "** In addition, this node's memory consumption may increase until all"
+ << startupWarningsLog;
+ log() << "** available free RAM is exhausted." << startupWarningsLog;
+ log() << startupWarningsLog;
+ } else if (!storageEngine->isDurable()) {
+ log() << startupWarningsLog;
+ log() << "** WARNING: This replica set node 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()
+ << "** In addition, this node's memory consumption may increase until all"
+ << startupWarningsLog;
+ log() << "** available free RAM is exhausted." << startupWarningsLog;
+ log() << startupWarningsLog;
+ }
}