diff options
author | Greg Studer <greg@10gen.com> | 2014-04-02 12:54:44 -0400 |
---|---|---|
committer | Greg Studer <greg@10gen.com> | 2014-04-02 12:54:44 -0400 |
commit | 93b962665da9d3163cacaf55817d8d60a957a32a (patch) | |
tree | 7410a0ee2e4ba6f707bb6b71ef03b020849fd9ea /jstests/sharding/migration_failure.js | |
parent | 9b65ac6d4361c07374b9e95e41afd6c2a3199b8e (diff) | |
download | mongo-93b962665da9d3163cacaf55817d8d60a957a32a.tar.gz |
SERVER-13459 improved migration rollback test
Diffstat (limited to 'jstests/sharding/migration_failure.js')
-rw-r--r-- | jstests/sharding/migration_failure.js | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/jstests/sharding/migration_failure.js b/jstests/sharding/migration_failure.js index 65b21661a74..236a451f8c5 100644 --- a/jstests/sharding/migration_failure.js +++ b/jstests/sharding/migration_failure.js @@ -22,20 +22,43 @@ st.printShardingStatus(); jsTest.log("Testing failed migrations..."); +var version = null; +var failVersion = null; + +assert.commandWorked( + st.shard0.getDB("admin").runCommand({ + configureFailPoint : 'failMigrationCommit', mode : 'alwaysOn' })); + +version = st.shard0.getDB("admin").runCommand({ getShardVersion : coll.toString() }); + +assert.commandFailed( admin.runCommand({ moveChunk : coll + "", + find : { _id : 0 }, + to : shards[1]._id }) ); + +failVersion = st.shard0.getDB("admin").runCommand({ getShardVersion : coll.toString() }); + +assert.commandWorked( + st.shard0.getDB("admin").runCommand({ + configureFailPoint : 'failMigrationCommit', mode : 'off' })); + assert.commandWorked( st.shard0.getDB("admin").runCommand({ configureFailPoint : 'failMigrationConfigWritePrepare', mode : 'alwaysOn' })); -var version = st.shard0.getDB("admin").runCommand({ getShardVersion : coll.toString() }); +version = st.shard0.getDB("admin").runCommand({ getShardVersion : coll.toString() }); assert.commandFailed( admin.runCommand({ moveChunk : coll + "", find : { _id : 0 }, to : shards[1]._id }) ); -var failVersion = st.shard0.getDB("admin").runCommand({ getShardVersion : coll.toString() }); +failVersion = st.shard0.getDB("admin").runCommand({ getShardVersion : coll.toString() }); assert.eq(version.global, failVersion.global); +assert.commandWorked( + st.shard0.getDB("admin").runCommand({ + configureFailPoint : 'failMigrationConfigWritePrepare', mode : 'off' })); + jsTest.log( "DONE!" ); st.stop(); |