diff options
Diffstat (limited to 'jstests/sharding/move_chunk_remove_shard.js')
-rw-r--r-- | jstests/sharding/move_chunk_remove_shard.js | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/jstests/sharding/move_chunk_remove_shard.js b/jstests/sharding/move_chunk_remove_shard.js index 352d18c7109..6cafa8a4a3c 100644 --- a/jstests/sharding/move_chunk_remove_shard.js +++ b/jstests/sharding/move_chunk_remove_shard.js @@ -10,7 +10,8 @@ (function() { "use strict"; -load('./jstests/libs/chunk_manipulation_util.js'); +load('jstests/libs/chunk_manipulation_util.js'); +load('jstests/sharding/libs/remove_shard_util.js'); // TODO SERVER-50144 Remove this and allow orphan checking. // This test calls removeShard which can leave docs in config.rangeDeletions in state "pending", @@ -47,19 +48,7 @@ let joinMoveChunk = moveChunkParallel(staticMongod, waitForMoveChunkStep(st.shard0, moveChunkStepNames.reachedSteadyState); -assert.soon(function() { - let res = assert.commandWorked(st.s.adminCommand({removeShard: st.shard1.shardName})); - if (!res.ok && res.code === ErrorCodes.ShardNotFound) { - // If the config server primary steps down right after removing the config.shards doc - // for the shard but before responding with "state": "completed", the mongos would retry - // the _configsvrRemoveShard command against the new config server primary, which would - // not find the removed shard in its ShardRegistry if it has done a ShardRegistry reload - // after the config.shards doc for the shard was removed. This would cause the command - // to fail with ShardNotFound. - return true; - } - return res.state == 'completed'; -}); +removeShard(st, st.shard1.shardName); unpauseMoveChunkAtStep(st.shard0, moveChunkStepNames.reachedSteadyState); |