summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2016-08-23 15:24:18 -0400
committerSpencer T Brody <spencer@mongodb.com>2016-08-23 15:24:18 -0400
commitdd74cff611986d34464fd4476e67dbcd6443d3ca (patch)
tree0f9b2e954fcb246c14958d0aea21236e37b6c1ce /src
parent2735da6940074624236068709dd05e9404ddf328 (diff)
downloadmongo-dd74cff611986d34464fd4476e67dbcd6443d3ca.tar.gz
SERVER-25475 SERVER-25155 Don't perform write for FeatureCompabilityVersion until replication is started up
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/db.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index fca61a49752..68a60d4e2b5 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -721,13 +721,6 @@ static ExitCode _initAndListen(int listenPort) {
HostnameCanonicalizationWorker::start(getGlobalServiceContext());
- if (!replSettings.usingReplSets() && !replSettings.isSlave() &&
- storageGlobalParams.engine != "devnull") {
- ScopedTransaction transaction(startupOpCtx.get(), MODE_X);
- Lock::GlobalWrite lk(startupOpCtx.get()->lockState());
- FeatureCompatibilityVersion::setIfCleanStartup(startupOpCtx.get());
- }
-
uassertStatusOK(ShardingState::get(startupOpCtx.get())
->initializeShardingAwarenessIfNeeded(startupOpCtx.get()));
@@ -771,8 +764,14 @@ static ExitCode _initAndListen(int listenPort) {
} else {
startTTLBackgroundJob();
}
- }
+ if (!replSettings.usingReplSets() && !replSettings.isSlave() &&
+ storageGlobalParams.engine != "devnull") {
+ ScopedTransaction transaction(startupOpCtx.get(), MODE_X);
+ Lock::GlobalWrite lk(startupOpCtx.get()->lockState());
+ FeatureCompatibilityVersion::setIfCleanStartup(startupOpCtx.get());
+ }
+ }
startClientCursorMonitor();