summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2022-04-12 07:17:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-19 10:27:01 +0000
commit169a54fd049eba6e0f522fce9d9907d9ab64bb50 (patch)
treed48a3b07c3209778fdaa00bff61c2eb0185f1236
parent9a75d576cffbc84581b2476127bf89fd214b7f0f (diff)
downloadmongo-169a54fd049eba6e0f522fce9d9907d9ab64bb50.tar.gz
SERVER-62690 Shard is shutting down before finishing draining in test
(cherry picked from commit 9f06d30d0701e6b224598e19b5d63a257f4ed554)
-rw-r--r--jstests/sharding/auth_add_shard.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/jstests/sharding/auth_add_shard.js b/jstests/sharding/auth_add_shard.js
index 23708eb2b42..1aab96e9f0a 100644
--- a/jstests/sharding/auth_add_shard.js
+++ b/jstests/sharding/auth_add_shard.js
@@ -100,6 +100,20 @@ assert.soon(function() {
return result.ok && result.state == "completed";
}, "failed to drain shard completely", 5 * 60 * 1000);
+// create user directly on new shard to allow direct reads from config.migrationCoordinators
+rst.getPrimary()
+ .getDB(adminUser.db)
+ .createUser({user: adminUser.username, pwd: adminUser.password, roles: jsTest.adminUserRoles});
+rst.getPrimary().getDB(adminUser.db).auth(adminUser.username, adminUser.password);
+
+// wait until migration coordinator is finished
+assert.soon(function() {
+ let migrationCoordinatorDocs =
+ rst.getPrimary().getDB('config').migrationCoordinators.find().toArray();
+
+ return migrationCoordinatorDocs.length === 0;
+}, "failed to remove migration coordinator", 5 * 60 * 1000);
+
assert.eq(1, st.config.shards.count(), "removed server still appears in count");
rst.stopSet();