summaryrefslogtreecommitdiff
path: root/jstests/sharding/remove3.js
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2018-02-07 17:38:49 -0500
committerjannaerin <golden.janna@gmail.com>2018-03-09 00:40:40 -0500
commitda1e0304e8eb91711ea1c78eb8f62538b53680e7 (patch)
treee55d32a40a76a39e01d8848c5a17d97ad640b18e /jstests/sharding/remove3.js
parent0d5370783beeb4936a181dd2f69387da4b5e816c (diff)
downloadmongo-da1e0304e8eb91711ea1c78eb8f62538b53680e7.tar.gz
SERVER-32052 Update ShardingTest to default to starting shard servers as replica sets
Diffstat (limited to 'jstests/sharding/remove3.js')
-rw-r--r--jstests/sharding/remove3.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/jstests/sharding/remove3.js b/jstests/sharding/remove3.js
index fdbaeb4d142..ab066f92f9d 100644
--- a/jstests/sharding/remove3.js
+++ b/jstests/sharding/remove3.js
@@ -5,7 +5,7 @@
var st = new ShardingTest({name: "remove_shard3", shards: 2, mongos: 2});
assert.commandWorked(st.s0.adminCommand({enableSharding: 'TestDB'}));
- st.ensurePrimaryShard('TestDB', 'shard0000');
+ st.ensurePrimaryShard('TestDB', st.shard0.shardName);
assert.commandWorked(st.s0.adminCommand({shardCollection: 'TestDB.Coll', key: {_id: 1}}));
assert.commandWorked(st.s0.adminCommand({split: 'TestDB.Coll', middle: {_id: 0}}));
@@ -14,25 +14,25 @@
st.s0.getDB('TestDB').Coll.insert({_id: 1, value: 'Positive value'});
assert.commandWorked(st.s0.adminCommand(
- {moveChunk: 'TestDB.Coll', find: {_id: 1}, to: 'shard0001', _waitForDelete: true}));
+ {moveChunk: 'TestDB.Coll', find: {_id: 1}, to: st.shard1.shardName, _waitForDelete: true}));
// Make sure both mongos instances know of the latest metadata
assert.eq(2, st.s0.getDB('TestDB').Coll.find({}).toArray().length);
assert.eq(2, st.s1.getDB('TestDB').Coll.find({}).toArray().length);
- // Remove shard0001
+ // Remove st.shard1.shardName
var removeRes;
- removeRes = assert.commandWorked(st.s0.adminCommand({removeShard: 'shard0001'}));
+ removeRes = assert.commandWorked(st.s0.adminCommand({removeShard: st.shard1.shardName}));
assert.eq('started', removeRes.state);
- removeRes = assert.commandWorked(st.s0.adminCommand({removeShard: 'shard0001'}));
+ removeRes = assert.commandWorked(st.s0.adminCommand({removeShard: st.shard1.shardName}));
assert.eq('ongoing', removeRes.state);
- // Move the one chunk off shard0001
+ // Move the one chunk off st.shard1.shardName
assert.commandWorked(st.s0.adminCommand(
- {moveChunk: 'TestDB.Coll', find: {_id: 1}, to: 'shard0000', _waitForDelete: true}));
+ {moveChunk: 'TestDB.Coll', find: {_id: 1}, to: st.shard0.shardName, _waitForDelete: true}));
// Remove shard must succeed now
- removeRes = assert.commandWorked(st.s0.adminCommand({removeShard: 'shard0001'}));
+ removeRes = assert.commandWorked(st.s0.adminCommand({removeShard: st.shard1.shardName}));
assert.eq('completed', removeRes.state);
// Make sure both mongos instance refresh their metadata and do not reference the missing shard