diff options
author | Kevin Pulo <kevin.pulo@mongodb.com> | 2015-10-31 10:42:29 +1100 |
---|---|---|
committer | Kevin Pulo <kevin.pulo@mongodb.com> | 2015-10-31 10:42:29 +1100 |
commit | 12afbfc77916cf720316435cd9396f5c293db6c2 (patch) | |
tree | e11e7a11d72ee51f3fbb9d099fd9cd4598d113d6 | |
parent | 90d0da843c44962fb1a21e368cd95fe24b25c711 (diff) | |
download | mongo-12afbfc77916cf720316435cd9396f5c293db6c2.tar.gz |
SERVER-21150 move basic init log messages earlier
Specifically, ahead of socket and storage engine initialisation
-rw-r--r-- | src/mongo/db/db.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index fcfb1f1ea91..a77d99b1657 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -462,6 +462,30 @@ static void repairDatabasesAndCheckVersion() { static void _initAndListen(int listenPort) { Client::initThread("initandlisten"); + 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; @@ -507,31 +531,8 @@ static void _initAndListen(int listenPort) { getGlobalEnvironment()->setGlobalStorageEngine(storageGlobalParams.engine); - 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; logMongodStartupWarnings(storageGlobalParams); -#if defined(_WIN32) - printTargetMinOS(); -#endif - - logProcessDetails(); - { stringstream ss; ss << endl; |