summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2016-05-26 15:00:54 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2016-05-31 13:04:32 -0400
commitd0c19b82b88f3424dd40b7fd1bc7d4bbcf90414f (patch)
tree866c5dd120c314ccc675b0ea40adcfe00ddd1738
parent9e179455c3efc0781c7b4d12e121ec6b6459fa3a (diff)
downloadmongo-d0c19b82b88f3424dd40b7fd1bc7d4bbcf90414f.tar.gz
SERVER-24298 add ensurePrimaryShard to csrs_upgrade_mongod_using_movechunk.js
-rw-r--r--jstests/sharding/csrs_upgrade/csrs_upgrade_mongod_using_movechunk.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/jstests/sharding/csrs_upgrade/csrs_upgrade_mongod_using_movechunk.js b/jstests/sharding/csrs_upgrade/csrs_upgrade_mongod_using_movechunk.js
index 1894a4b3f69..9965d9c1b8d 100644
--- a/jstests/sharding/csrs_upgrade/csrs_upgrade_mongod_using_movechunk.js
+++ b/jstests/sharding/csrs_upgrade/csrs_upgrade_mongod_using_movechunk.js
@@ -21,6 +21,11 @@ var st;
jsTest.log("Enabling sharding on " + testDBName);
assert.commandWorked(st.s0.adminCommand({enablesharding: testDBName}));
+ // Ensure shard0 as the primary shard so that after it is restarted, it can still perform a
+ // moveChunk (if it had no chunks, the moveChunk would fail).
+ jsTest.log("Ensuring " + st.shard0.name + " as primary shard");
+ st.ensurePrimaryShard(testDBName, st.shard0.name);
+
jsTest.log("Creating a sharded collection " + dataCollectionName);
assert.commandWorked(st.s0.adminCommand({shardcollection: dataCollectionName, key: {_id: 1}}));