summaryrefslogtreecommitdiff
path: root/src/mongo/db/db.cpp
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2016-09-13 15:33:30 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2016-09-15 15:40:11 -0400
commit5b0901ea6a1b9b90d2cee8263b8c60013d7c6979 (patch)
tree521e4f207f6c844a47c0112f4b142ae3af09f64f /src/mongo/db/db.cpp
parenteec91f97a655486892f6c75342adcffc68109f0e (diff)
downloadmongo-5b0901ea6a1b9b90d2cee8263b8c60013d7c6979.tar.gz
SERVER-25458 unit tests for ShardingState::initializeShardingAwarenessIfNeeded
Diffstat (limited to 'src/mongo/db/db.cpp')
-rw-r--r--src/mongo/db/db.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 35b1250a81a..4722cf846a8 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -736,8 +736,12 @@ ExitCode _initAndListen(int listenPort) {
<< startupWarningsLog;
}
- uassertStatusOK(ShardingState::get(startupOpCtx.get())
- ->initializeShardingAwarenessIfNeeded(startupOpCtx.get()));
+ auto shardingInitialized =
+ uassertStatusOK(ShardingState::get(startupOpCtx.get())
+ ->initializeShardingAwarenessIfNeeded(startupOpCtx.get()));
+ if (shardingInitialized) {
+ reloadShardRegistryUntilSuccess(startupOpCtx.get());
+ }
if (!storageGlobalParams.readOnly) {
logStartup(startupOpCtx.get());