Permalink
Browse files

SERVER-6943: fix sh.addTagRange for 3 config servers

  • Loading branch information...
1 parent 9e3e96e commit 7c3283a3031e72da3c1f48a00e17f37b7d78f9e3 @scotthernandez scotthernandez committed with monkey101 Sep 17, 2012
Showing with 5 additions and 4 deletions.
  1. +2 −1 jstests/slowNightly/balance_tags1.js
  2. +3 −3 src/mongo/shell/utils_sh.js
@@ -1,5 +1,5 @@
-s = new ShardingTest( "balance_tags1" , 3 , 1 , 1 , { chunksize : 1 , nopreallocj : true } )
+s = new ShardingTest( "balance_tags1" , 3 , 1 , 1 , { sync:true, chunksize : 1 , nopreallocj : true } )
s.config.settings.update( { _id: "balancer" }, { $set : { stopped: false, _nosleep: true } } , true );
db = s.getDB( "test" );
@@ -42,6 +42,7 @@ assert.soon( function() {
return counts["shard0002"] == 0;
} , "balance 2 didn't happen" , 1000 * 60 * 10 , 1000 )
+printjson(sh.status());
s.stop();
@@ -341,8 +341,8 @@ sh.removeShardTag = function( shard, tag ) {
sh.addTagRange = function( ns, min, max, tag ) {
var config = db.getSisterDB( "config" );
- config.tags.update( { ns : ns , min : min } ,
- { ns : ns , min : min , max : max , tag : tag } ,
- true );
+ config.tags.update( {_id: { ns : ns , min : min } } ,
+ {_id: { ns : ns , min : min }, ns : ns , min : min , max : max , tag : tag } ,
+ true );
sh._checkLastError( config );
}

0 comments on commit 7c3283a

Please sign in to comment.