summaryrefslogtreecommitdiff
path: root/src/mongo/s/grid.cpp
diff options
context:
space:
mode:
authorGreg Studer <greg@10gen.com>2013-06-12 11:52:56 -0400
committerGreg Studer <greg@10gen.com>2013-06-13 12:07:32 -0400
commit01e4e857be20365b72867458b1a7f48fd8b1c689 (patch)
tree1831850a6f36bc3cb0c3b9f921054cb13d441910 /src/mongo/s/grid.cpp
parent77c838a35f2a1475b859ed869d9e018dc233e4c6 (diff)
downloadmongo-01e4e857be20365b72867458b1a7f48fd8b1c689.tar.gz
SERVER-9909 balancer reload idle sharded coll data, and don't abort round
Diffstat (limited to 'src/mongo/s/grid.cpp')
-rw-r--r--src/mongo/s/grid.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/s/grid.cpp b/src/mongo/s/grid.cpp
index 861964c6196..0c47ec686fc 100644
--- a/src/mongo/s/grid.cpp
+++ b/src/mongo/s/grid.cpp
@@ -30,11 +30,14 @@
#include "mongo/s/type_database.h"
#include "mongo/s/type_settings.h"
#include "mongo/s/type_shard.h"
+#include "mongo/util/fail_point_service.h"
#include "mongo/util/startup_test.h"
#include "mongo/util/stringutils.h"
namespace mongo {
+ MONGO_FP_DECLARE(neverBalance);
+
DBConfigPtr Grid::getDBConfig( string database , bool create , const string& shardNameHint ) {
{
string::size_type i = database.find( "." );
@@ -464,6 +467,9 @@ namespace mongo {
*/
bool Grid::shouldBalance( const string& ns, BSONObj* balancerDocOut ) const {
+ // Allow disabling the balancer for testing
+ if ( MONGO_FAIL_POINT(neverBalance) ) return false;
+
ScopedDbConnection conn(configServer.getPrimary().getConnString(), 30);
BSONObj balancerDoc;
BSONObj collDoc;