diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-04-26 15:03:55 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-04-26 15:34:26 -0400 |
commit | 1836409ef62456fb83361c2eb1a1e9189a5e3e60 (patch) | |
tree | bea081f1d4b4b4613ca1898aa27cb12a9e6df856 /jstests | |
parent | 6dfaea7ca3e29e421a86420de20fa11cdae690b6 (diff) | |
download | mongo-1836409ef62456fb83361c2eb1a1e9189a5e3e60.tar.gz |
SERVER-23192 startup_with_all_configs_down.js should restart the shards
While the config server is down, the shards' replica set monitor might
stop monitoring the config server and deem it permanently failed,
therefore to make the test robust, the mongod must be restarted.
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/sharding/startup_with_all_configs_down.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/jstests/sharding/startup_with_all_configs_down.js b/jstests/sharding/startup_with_all_configs_down.js index a2b47674777..5ad2ef56eb6 100644 --- a/jstests/sharding/startup_with_all_configs_down.js +++ b/jstests/sharding/startup_with_all_configs_down.js @@ -8,6 +8,15 @@ (function() { "use strict"; + /** + * Restarts the mongod backing the specified shard instance, without restarting the mongobridge. + */ + function restartShard(shard) { + MongoRunner.stopMongod(shard); + shard.restart = true; + MongoRunner.runMongod(shard); + } + var st = new ShardingTest({shards: 2}); jsTestLog("Setting up initial data"); @@ -41,9 +50,7 @@ }); jsTestLog("Restarting a shard while there are no config servers up"); - MongoRunner.stopMongod(st.shard1); - st.shard1.restart = true; - MongoRunner.runMongod(st.shard1); + restartShard(st.shard1); jsTestLog("Queries should fail because the shard can't initialize sharding state"); var error = assert.throws(function() { @@ -56,8 +63,10 @@ st.restartConfigServer(i); } - // TODO: SERVER-23192 - restart mongos because it has deemend the CSRS config server set as - // unusable + // TODO: SERVER-23192 - restart all shards and mongos because their replica set monitor has + // deemed the CSRS config server set as unusable. + restartShard(st.shard0); + restartShard(st.shard1); st.restartMongos(0); jsTestLog("Queries against the original mongos should work again"); |