From 02e789a65916d2ec180a6d49a6114f92cd9ff36f Mon Sep 17 00:00:00 2001 From: Jason Zhang Date: Tue, 15 Jun 2021 15:34:27 +0000 Subject: SERVER-57710 Ignore "can't connect to new replica set primary" in tenant dbhash check hook --- jstests/replsets/libs/tenant_migration_util.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)); } /** -- cgit v1.2.1