summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/feature_compatibility_version.cpp
diff options
context:
space:
mode:
authorDidier Nadeau <didier.nadeau@mongodb.com>2022-02-20 20:36:51 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-20 21:18:11 +0000
commitc8c31330d7b022ef59c97b97f3dfc9f244ccaef7 (patch)
tree715195d58b1e8aec37a19b4f0c4925bccefafb7a /src/mongo/db/commands/feature_compatibility_version.cpp
parentce3b2db6de5728e161a865caf3b03f352e6daeed (diff)
downloadmongo-c8c31330d7b022ef59c97b97f3dfc9f244ccaef7.tar.gz
SERVER-63266 Allow server to be started without setname in serverless mode
Diffstat (limited to 'src/mongo/db/commands/feature_compatibility_version.cpp')
-rw-r--r--src/mongo/db/commands/feature_compatibility_version.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/commands/feature_compatibility_version.cpp b/src/mongo/db/commands/feature_compatibility_version.cpp
index 5adcdffef21..b9af74e8847 100644
--- a/src/mongo/db/commands/feature_compatibility_version.cpp
+++ b/src/mongo/db/commands/feature_compatibility_version.cpp
@@ -468,12 +468,12 @@ void FeatureCompatibilityVersion::initializeForStartup(OperationContext* opCtx)
void FeatureCompatibilityVersion::fassertInitializedAfterStartup(OperationContext* opCtx) {
Lock::GlobalWrite lk(opCtx);
const auto replProcess = repl::ReplicationProcess::get(opCtx);
- const auto& replSettings = repl::ReplicationCoordinator::get(opCtx)->getSettings();
+ const bool usingReplication = repl::ReplicationCoordinator::get(opCtx)->isReplEnabled();
// The node did not complete the last initial sync. If the initial sync flag is set and we are
// part of a replica set, we expect the version to be initialized as part of initial sync after
// startup.
- bool needInitialSync = replSettings.usingReplSets() && replProcess &&
+ bool needInitialSync = usingReplication && replProcess &&
replProcess->getConsistencyMarkers()->getInitialSyncFlag(opCtx);
if (needInitialSync) {
return;
@@ -499,7 +499,7 @@ void FeatureCompatibilityVersion::fassertInitializedAfterStartup(OperationContex
// If we are part of a replica set and are started up with no data files, we do not set the
// featureCompatibilityVersion until a primary is chosen. For this case, we expect the in-memory
// featureCompatibilityVersion parameter to still be uninitialized until after startup.
- if (isWriteableStorageEngine() && (!replSettings.usingReplSets() || nonLocalDatabases)) {
+ if (isWriteableStorageEngine() && (!usingReplication || nonLocalDatabases)) {
invariant(serverGlobalParams.featureCompatibility.isVersionInitialized());
}
}