summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrace Luong <grace.luong@mongodb.com>2020-07-15 21:53:03 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-15 23:08:41 +0000
commitf1c2d6c29d960506c770958ed39ebe0677a3fdda (patch)
treea55510613f572662ccc705d58258fd20453ae33b
parent8dd68436b1347849877b013face3184565615636 (diff)
downloadmongo-f1c2d6c29d960506c770958ed39ebe0677a3fdda.tar.gz
SERVER-49069: Add startup warning when arbiter is running a quarterly version
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp15
-rw-r--r--src/mongo/db/server_options.h3
2 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 441f088648a..124e3aa1cd2 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -4402,6 +4402,21 @@ ReplicationCoordinatorImpl::_setCurrentRSConfig(WithLock lk,
_topCoord->updateConfig(newConfig, myIndex, _replExecutor->now());
+ // It is only necessary to check if an arbiter is running on a quarterly binary version when a
+ // fresh node is added to the replica set as an arbiter and when an old secondary node is
+ // removed and then re-added to the replica set as an arbiter. That's why we only need to warn
+ // once per process as converting from secondary to arbiter normally requires a server shutdown.
+ static std::once_flag checkArbiterOnQuarterlyBinaryVersion;
+ std::call_once(checkArbiterOnQuarterlyBinaryVersion, [this] {
+ // Warn if an arbiter is running on a quarterly binary version.
+ if (_topCoord->getMemberState().arbiter() && !ServerGlobalParams::kIsLTSBinaryVersion) {
+ LOGV2_WARNING_OPTIONS(
+ 4906901,
+ {logv2::LogTag::kStartupWarnings},
+ "** WARNING: Arbiters are not supported in quarterly binary versions");
+ }
+ });
+
// updateConfig() can change terms, so update our term shadow to match.
_termShadow.store(_topCoord->getTerm());
diff --git a/src/mongo/db/server_options.h b/src/mongo/db/server_options.h
index 05130d67482..2b2f88dee47 100644
--- a/src/mongo/db/server_options.h
+++ b/src/mongo/db/server_options.h
@@ -151,6 +151,9 @@ struct ServerGlobalParams {
// queryableBackupMode.
BSONObj overrideShardIdentity;
+ // True if the current binary version is an LTS Version.
+ static constexpr bool kIsLTSBinaryVersion = false;
+
struct FeatureCompatibility {
/**
* The combination of the fields (version, targetVersion) in the featureCompatiiblityVersion