summaryrefslogtreecommitdiff
path: root/jstests/replsets/libs/tenant_migration_util.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/replsets/libs/tenant_migration_util.js')
-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));
}
/**