summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Kangas <matt.kangas@mongodb.com>2014-10-21 17:19:30 -0400
committerMatt Kangas <matt.kangas@mongodb.com>2014-10-23 12:06:37 -0400
commit602fa05f61b61835b92c8efed2e3354d92ebbe66 (patch)
treea26c706aed9c15dc682ac503e4167670858ca7c9 /src
parentc76d80bce0212fe9770ddb6876878eb16014769b (diff)
downloadmongo-602fa05f61b61835b92c8efed2e3354d92ebbe66.tar.gz
SERVER-10824 sh.enableBalancing() now requires an argument
Diffstat (limited to 'src')
-rw-r--r--src/mongo/shell/utils_sh.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/shell/utils_sh.js b/src/mongo/shell/utils_sh.js
index e420c1a6544..e08f4301aa8 100644
--- a/src/mongo/shell/utils_sh.js
+++ b/src/mongo/shell/utils_sh.js
@@ -44,6 +44,9 @@ sh.help = function() {
print( "\tsh.getBalancerState() return true if enabled" );
print( "\tsh.isBalancerRunning() return true if the balancer has work in progress on any mongos" );
+ print( "\tsh.disableBalancing(coll) disable balancing on one collection" );
+ print( "\tsh.enableBalancing(coll) re-enable balancing on one collection" );
+
print( "\tsh.addShardTag(shard,tag) adds the tag to the shard" );
print( "\tsh.removeShardTag(shard,tag) removes the tag from the shard" );
print( "\tsh.addTagRange(fullName,min,max,tag) tags the specified range of the given collection" );
@@ -258,12 +261,18 @@ sh.waitForBalancer = function( onOrNot, timeout, interval ){
}
sh.disableBalancing = function( coll ){
+ if (coll === undefined) {
+ throw Error("Must specify collection");
+ }
var dbase = db
if( coll instanceof DBCollection ) dbase = coll.getDB()
dbase.getSisterDB( "config" ).collections.update({ _id : coll + "" }, { $set : { "noBalance" : true } })
}
sh.enableBalancing = function( coll ){
+ if (coll === undefined) {
+ throw Error("Must specify collection");
+ }
var dbase = db
if( coll instanceof DBCollection ) dbase = coll.getDB()
dbase.getSisterDB( "config" ).collections.update({ _id : coll + "" }, { $set : { "noBalance" : false } })
@@ -439,4 +448,4 @@ sh.getRecentMigrations = function() {
{ $project : { _id : "$_id.msg" , from : "$_id.from", to : "$_id.to" , count : "$count" } }
] ).toArray());
return result;
-} \ No newline at end of file
+}