diff options
Diffstat (limited to 'src/mongo/s/commands_admin.cpp')
-rw-r--r-- | src/mongo/s/commands_admin.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/s/commands_admin.cpp b/src/mongo/s/commands_admin.cpp index c155e25066d..cd5aaaa69a2 100644 --- a/src/mongo/s/commands_admin.cpp +++ b/src/mongo/s/commands_admin.cpp @@ -35,6 +35,7 @@ #include "../client/connpool.h" #include "mongo/client/dbclientcursor.h" +#include "mongo/db/namespacestring.h" #include "../db/dbmessage.h" #include "../db/commands.h" @@ -712,14 +713,14 @@ namespace mongo { if ( ! okForConfigChanges( errmsg ) ) return false; - ShardConnection::sync(); - string ns = cmdObj.firstElement().valuestrsafe(); if ( ns.size() == 0 ) { errmsg = "no ns"; return false; } + ShardConnection::sync( NamespaceString(ns).db ); + DBConfigPtr config = grid.getDBConfig( ns ); if ( ! config->isSharded( ns ) ) { config->reload(); @@ -794,15 +795,16 @@ namespace mongo { if ( ! okForConfigChanges( errmsg ) ) return false; - ShardConnection::sync(); - - Timer t; string ns = cmdObj.firstElement().valuestrsafe(); if ( ns.size() == 0 ) { errmsg = "no ns"; return false; } + ShardConnection::sync( NamespaceString(ns).db ); + + Timer t; + DBConfigPtr config = grid.getDBConfig( ns ); if ( ! config->isSharded( ns ) ) { config->reload(); |