diff options
-rw-r--r-- | src/mongo/db/db.cpp | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index d41f1885b99..4f2d3676f19 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -404,6 +404,32 @@ static void repairDatabasesAndCheckVersion(OperationContext* txn) { static void _initAndListen(int listenPort) { Client::initThread("initandlisten"); + getGlobalServiceContext()->setOpObserver(stdx::make_unique<OpObserver>()); + + const repl::ReplSettings& replSettings = repl::getGlobalReplicationCoordinator()->getSettings(); + + { + ProcessId pid = ProcessId::getCurrent(); + LogstreamBuilder l = log(LogComponent::kControl); + l << "MongoDB starting : pid=" << pid << " port=" << serverGlobalParams.port + << " dbpath=" << storageGlobalParams.dbpath; + if (replSettings.master) + l << " master=" << replSettings.master; + if (replSettings.slave) + l << " slave=" << (int)replSettings.slave; + + const bool is32bit = sizeof(int*) == 4; + l << (is32bit ? " 32" : " 64") << "-bit host=" << getHostNameCached() << endl; + } + + DEV log(LogComponent::kControl) << "DEBUG build (which is slower)" << endl; + +#if defined(_WIN32) + printTargetMinOS(); +#endif + + logProcessDetails(); + // Due to SERVER-15389, we must setupSockets first thing at startup in order to avoid // obtaining too high a file descriptor for our calls to select(). MessageServer::Options options; @@ -461,10 +487,6 @@ static void _initAndListen(int listenPort) { } } - getGlobalServiceContext()->setOpObserver(stdx::make_unique<OpObserver>()); - - const repl::ReplSettings& replSettings = repl::getGlobalReplicationCoordinator()->getSettings(); - if (!getGlobalServiceContext()->getGlobalStorageEngine()->getSnapshotManager()) { if (moe::startupOptionsParsed.count("replication.enableMajorityReadConcern")) { // Note: we are intentionally only erroring if the user explicitly requested that we @@ -479,29 +501,8 @@ static void _initAndListen(int listenPort) { } } - { - ProcessId pid = ProcessId::getCurrent(); - LogstreamBuilder l = log(LogComponent::kControl); - l << "MongoDB starting : pid=" << pid << " port=" << serverGlobalParams.port - << " dbpath=" << storageGlobalParams.dbpath; - if (replSettings.master) - l << " master=" << replSettings.master; - if (replSettings.slave) - l << " slave=" << (int)replSettings.slave; - - const bool is32bit = sizeof(int*) == 4; - l << (is32bit ? " 32" : " 64") << "-bit host=" << getHostNameCached() << endl; - } - - DEV log(LogComponent::kControl) << "DEBUG build (which is slower)" << endl; logMongodStartupWarnings(storageGlobalParams, serverGlobalParams); -#if defined(_WIN32) - printTargetMinOS(); -#endif - - logProcessDetails(); - { stringstream ss; ss << endl; |