summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zhang <jason.zhang@mongodb.com>2021-06-15 15:34:27 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-16 13:20:00 +0000
commit02e789a65916d2ec180a6d49a6114f92cd9ff36f (patch)
tree8436bc22f3b0bc134224d8e2dbeaa5b1def6edc5
parent6729afa6c6f081333973601172fafa7c71741508 (diff)
downloadmongo-02e789a65916d2ec180a6d49a6114f92cd9ff36f.tar.gz
SERVER-57710 Ignore "can't connect to new replica set primary" in tenant dbhash check hook
-rw-r--r--jstests/replsets/libs/tenant_migration_util.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/jstests/replsets/libs/tenant_migration_util.js b/jstests/replsets/libs/tenant_migration_util.js
index 17178b6bed7..3d1a62bbd80 100644
--- a/jstests/replsets/libs/tenant_migration_util.js
+++ b/jstests/replsets/libs/tenant_migration_util.js
@@ -431,6 +431,13 @@ var TenantMigrationUtil = (function() {
* Checks if an error gotten while doing a tenant dbhash check is retriable.
*/
function checkIfRetriableErrorForTenantDbHashCheck(error) {
+ // Due to the shell not propagating error codes correctly, if we get any of the following
+ // error messages, we can retry the operation.
+ const retryableErrorMessages = [
+ "The server is in quiesce mode and will shut down",
+ "can't connect to new replica set primary"
+ ];
+
return isRetryableError(error) || isNetworkError(error) ||
// If there's a failover while we're running a dbhash check, the elected secondary might
// not have set the tenantMigrationDonorAllowsNonTimestampedReads failpoint, which means
@@ -443,7 +450,7 @@ var TenantMigrationUtil = (function() {
error.code == ErrorCodes.NotYetInitialized ||
// TODO (SERVER-54026): Remove check for error message once the shell correctly
// propagates the error code.
- error.message.includes("The server is in quiesce mode and will shut down");
+ retryableErrorMessages.some(msg => error.message.includes(msg));
}
/**