diff options
author | Allison Easton <allison.easton@mongodb.com> | 2022-04-12 07:17:52 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-19 11:15:14 +0000 |
commit | 2998287dbeba3a729258693ae9056fc762d724e4 (patch) | |
tree | 5b94388f0b226f36bddc4962b7340cab02ba300b | |
parent | 786da5e3aa473b78b5281538e55c1fd44a7eb2ca (diff) | |
download | mongo-2998287dbeba3a729258693ae9056fc762d724e4.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.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/jstests/sharding/auth_add_shard.js b/jstests/sharding/auth_add_shard.js index 38cb9853813..1e292d243d0 100644 --- a/jstests/sharding/auth_add_shard.js +++ b/jstests/sharding/auth_add_shard.js @@ -94,6 +94,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(); |