diff options
Diffstat (limited to 'jstests/sharding/count2.js')
-rw-r--r-- | jstests/sharding/count2.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/jstests/sharding/count2.js b/jstests/sharding/count2.js index 7361359791d..387bee9f8e3 100644 --- a/jstests/sharding/count2.js +++ b/jstests/sharding/count2.js @@ -14,29 +14,29 @@ var db2 = s2.getDB( "test" ).foo; assert.eq( 1, s1.config.chunks.count(), "sanity check A"); -db1.save( { name : "aaa" } ) -db1.save( { name : "bbb" } ) -db1.save( { name : "ccc" } ) -db1.save( { name : "ddd" } ) -db1.save( { name : "eee" } ) -db1.save( { name : "fff" } ) +db1.save( { name : "aaa" } ); +db1.save( { name : "bbb" } ); +db1.save( { name : "ccc" } ); +db1.save( { name : "ddd" } ); +db1.save( { name : "eee" } ); +db1.save( { name : "fff" } ); s1.adminCommand( { split : "test.foo" , middle : { name : "ddd" } } ); assert.eq( 3, db1.count( { name : { $gte: "aaa" , $lt: "ddd" } } ) , "initial count mongos1" ); assert.eq( 3, db2.count( { name : { $gte: "aaa" , $lt: "ddd" } } ) , "initial count mongos2" ); -s1.printChunks( "test.foo" ) +s1.printChunks( "test.foo" ); s1.adminCommand( { movechunk : "test.foo" , find : { name : "aaa" } , to : s1.getOther( s1.getServer( "test" ) ).name, _waitForDelete : true }); assert.eq( 3, db1.count( { name : { $gte: "aaa" , $lt: "ddd" } } ) , "post count mongos1" ); // The second mongos still thinks its shard mapping is valid and accepts a cound -print( "before sleep: " + Date() ) -sleep( 2000 ) -print( "after sleep: " + Date() ) -s1.printChunks( "test.foo" ) +print( "before sleep: " + Date() ); +sleep( 2000 ); +print( "after sleep: " + Date() ); +s1.printChunks( "test.foo" ); assert.eq( 3, db2.find( { name : { $gte: "aaa" , $lt: "ddd" } } ).count() , "post count mongos2" ); db2.findOne(); |