summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2014-04-14 14:52:07 -0400
committerDan Pasette <dan@mongodb.com>2014-04-16 10:49:15 -0400
commitf621320bee2a36e560b65e4e1ffc754a9be95894 (patch)
tree8f16088d2111db3433988b920e09b44521ad90eb
parentb39c5ee1eaf1507e7f9149330520e01d5c060340 (diff)
downloadmongo-f621320bee2a36e560b65e4e1ffc754a9be95894.tar.gz
SERVER-13579 Wait for deletion after migration in feature2.js
(cherry picked from commit b3aaf2e5809e272367b0f60f66938d8bf712702c)
-rw-r--r--jstests/sharding/features2.js9
-rw-r--r--src/mongo/shell/shardingtest.js6
2 files changed, 5 insertions, 10 deletions
diff --git a/jstests/sharding/features2.js b/jstests/sharding/features2.js
index 86eab1baabc..2a32218b717 100644
--- a/jstests/sharding/features2.js
+++ b/jstests/sharding/features2.js
@@ -26,12 +26,7 @@ assert( a.foo.distinct("x").length == 0 || b.foo.distinct("x").length == 0 , "di
assert.eq( 1 , s.onNumShards( "foo" ) , "A1" );
-s.shardGo( "foo" , { x : 1 } , { x : 2 } , { x : 3 } );
-
-assert.soon( function(){
- print( "Waiting for migration cleanup to occur..." );
- return db.foo.count() == db.foo.find().itcount();
-})
+s.shardGo( "foo" , { x : 1 } , { x : 2 } , { x : 3 }, null, true /* waitForDelete */ );
assert.eq( 2 , s.onNumShards( "foo" ) , "A2" );
@@ -140,7 +135,7 @@ doMR = function( n ){
doMR( "before" );
assert.eq( 1 , s.onNumShards( "mr" ) , "E1" );
-s.shardGo( "mr" , { x : 1 } , { x : 2 } , { x : 3 } );
+s.shardGo( "mr" , { x : 1 } , { x : 2 } , { x : 3 }, null, true /* waitForDelete */ );
assert.eq( 2 , s.onNumShards( "mr" ) , "E1" );
doMR( "after" );
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js
index 3c89067b550..944306fbb19 100644
--- a/src/mongo/shell/shardingtest.js
+++ b/src/mongo/shell/shardingtest.js
@@ -896,8 +896,8 @@ ShardingTest.prototype.isSharded = function( collName ){
}
-ShardingTest.prototype.shardGo = function( collName , key , split , move , dbName ){
-
+ShardingTest.prototype.shardGo = function( collName , key , split , move , dbName, waitForDelete ){
+
split = ( split != false ? ( split || key ) : split )
move = ( split != false && move != false ? ( move || split ) : false )
@@ -932,7 +932,7 @@ ShardingTest.prototype.shardGo = function( collName , key , split , move , dbNam
var result = null
for( var i = 0; i < 5; i++ ){
- result = this.s.adminCommand( { movechunk : c , find : move , to : this.getOther( this.getServer( dbName ) ).name } );
+ result = this.s.adminCommand( { movechunk : c , find : move , to : this.getOther( this.getServer( dbName ) ).name, _waitForDelete: waitForDelete } );
if( result.ok ) break;
sleep( 5 * 1000 );
}