diff options
author | Alberto Lerner <alerner@10gen.com> | 2010-06-08 16:01:52 -0400 |
---|---|---|
committer | Alberto Lerner <alerner@10gen.com> | 2010-06-08 16:01:52 -0400 |
commit | 88c7f167677b0765e7f0de0ca1476eb5e4078832 (patch) | |
tree | 72ace2902b60ecd72b8e717efc8996a99d934182 /s/balance.cpp | |
parent | 57a2b786e50e22f3f273d9f95442153d43482e21 (diff) | |
download | mongo-88c7f167677b0765e7f0de0ca1476eb5e4078832.tar.gz |
Better balancer messages
Diffstat (limited to 's/balance.cpp')
-rw-r--r-- | s/balance.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/s/balance.cpp b/s/balance.cpp index 79d4736685e..8d8fe2e91e6 100644 --- a/s/balance.cpp +++ b/s/balance.cpp @@ -184,8 +184,6 @@ namespace mongo { void Balancer::_doBalanceRound( DBClientBase& conn, vector<CandidateChunkPtr>* candidateChunks ){ assert( candidateChunks ); - log(1) << "balancer: start balancing round" << endl; - // // 1. Check whether there is any sharded collection to be balanced by querying // the ShardsNS::database collection @@ -309,14 +307,18 @@ namespace mongo { vector<CandidateChunkPtr> candidateChunks; if ( _shouldIBalance( conn.conn() ) ){ + log(1) << "balancer: start balancing round" << endl; candidateChunks.clear(); _doBalanceRound( conn.conn() , &candidateChunks ); - if ( candidateChunks.size() > 0 ) { + if ( candidateChunks.size() == 0 ) { + log(1) << "balancer: no need to move any chunk" << endl; + + } else { _balancedLastTime = _moveChunks( &candidateChunks ); + log(1) << "balancer: end balancing round" << endl; } } - conn.done(); } catch ( std::exception& e ){ |