summaryrefslogtreecommitdiff
path: root/src/mongo/db/db.cpp
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2018-12-11 21:36:34 -0500
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2018-12-11 22:01:34 -0500
commit17532dff912ceb6233cd8d7db8c1b47e4859ffaf (patch)
tree353ec2d0b56de43958c03755038dca0d53fcd197 /src/mongo/db/db.cpp
parent3b7720f9a4209e9b4b18f7d8e98f29b574775f76 (diff)
downloadmongo-17532dff912ceb6233cd8d7db8c1b47e4859ffaf.tar.gz
SERVER-38128 Start periodic runner before the storage engine
Diffstat (limited to 'src/mongo/db/db.cpp')
-rw-r--r--src/mongo/db/db.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index ba360c0fbff..f2af3d38ec6 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -331,6 +331,13 @@ ExitCode _initAndListen(int listenPort) {
}
serviceContext->setTransportLayer(std::move(tl));
}
+
+ // Set up the periodic runner for background job execution. This is required to be running
+ // before the storage engine is initialized.
+ auto runner = makePeriodicRunner(serviceContext);
+ runner->startup();
+ serviceContext->setPeriodicRunner(std::move(runner));
+
initializeStorageEngine(serviceContext, StorageEngineInitFlags::kNone);
#ifdef MONGO_CONFIG_WIREDTIGER_ENABLED
@@ -516,11 +523,6 @@ ExitCode _initAndListen(int listenPort) {
<< startupWarningsLog;
}
- // Set up the periodic runner for background job execution
- auto runner = makePeriodicRunner(serviceContext);
- runner->startup();
- serviceContext->setPeriodicRunner(std::move(runner));
-
// This function may take the global lock.
auto shardingInitialized = ShardingInitializationMongoD::get(startupOpCtx.get())
->initializeShardingAwarenessIfNeeded(startupOpCtx.get());