summaryrefslogtreecommitdiff
path: root/s/balance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 's/balance.cpp')
-rw-r--r--s/balance.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/s/balance.cpp b/s/balance.cpp
index ee0c992..8b01ea7 100644
--- a/s/balance.cpp
+++ b/s/balance.cpp
@@ -276,20 +276,21 @@ namespace mongo {
try {
- // first make sure we should even be running
+ ScopedDbConnection conn( config );
+
+ // ping has to be first so we keep things in the config server in sync
+ _ping( conn.conn() );
+
+ // now make sure we should even be running
if ( ! grid.shouldBalance() ) {
log(1) << "skipping balancing round because balancing is disabled" << endl;
+ conn.done();
+
sleepsecs( 30 );
continue;
}
-
- ScopedDbConnection conn( config );
-
- _ping( conn.conn() );
- if ( ! _checkOIDs() ) {
- uassert( 13258 , "oids broken after resetting!" , _checkOIDs() );
- }
+ uassert( 13258 , "oids broken after resetting!" , _checkOIDs() );
// use fresh shard state
Shard::reloadShardInfo();