Skip to content

Commit b62e772

Browse files
SERVER-6943: fix sh.addTagRange for 3 config servers
1 parent 563d64e commit b62e772

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

jstests/slowNightly/balance_tags1.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
s = new ShardingTest( "balance_tags1" , 3 , 1 , 1 , { chunksize : 1 , nopreallocj : true } )
2+
s = new ShardingTest( "balance_tags1" , 3 , 1 , 1 , { sync:true, chunksize : 1 , nopreallocj : true } )
33
s.config.settings.update( { _id: "balancer" }, { $set : { stopped: false, _nosleep: true } } , true );
44

55
db = s.getDB( "test" );
@@ -42,6 +42,7 @@ assert.soon( function() {
4242
return counts["shard0002"] == 0;
4343
} , "balance 2 didn't happen" , 1000 * 60 * 10 , 1000 )
4444

45+
printjson(sh.status());
4546

4647
s.stop();
4748

src/mongo/shell/utils_sh.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@ sh.removeShardTag = function( shard, tag ) {
341341

342342
sh.addTagRange = function( ns, min, max, tag ) {
343343
var config = db.getSisterDB( "config" );
344-
config.tags.update( { ns : ns , min : min } ,
345-
{ ns : ns , min : min , max : max , tag : tag } ,
346-
true );
344+
config.tags.update( {_id: { ns : ns , min : min } } ,
345+
{_id: { ns : ns , min : min }, ns : ns , min : min , max : max , tag : tag } ,
346+
true );
347347
sh._checkLastError( config );
348348
}

0 commit comments

Comments
 (0)