jstests/replsets/libs/tenant_migration_util.js
/**
     * Checks if an error gotten while doing a tenant dbhash check is retryable.
     */
Checks if an error gotten while doing a tenant dbhash check is retryable.
Checks if an error gotten while doing a tenant dbhash check is retryable .
function checkIfRetryableErrorForTenantDbHashCheck(error) {
        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) ||
            ErrorCodes.isTenantMigrationError(error.code) ||
            error.code == ErrorCodes.NotYetInitialized ||
            retryableErrorMessages.some(msg => error.message.includes(msg));
    }
function checkIfRetryableErrorForTenantDbHashCheck ( error ) { 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 ) || ErrorCodes . isTenantMigrationError ( error . code ) || error . code == ErrorCodes . NotYetInitialized || retryableErrorMessages . some ( msg => error . message . includes ( msg ) ) ; }
Checks if an error gotten while doing a tenant dbhash check is retryable.
Checks if an error gotten while doing a tenant dbhash check is retryable .
// Due to the shell not propagating error codes correctly, if we get any of the following // error messages, we can retry the operation. // The following shell helper methods check if the error message contains some // notion of retryability. This is in case the error does not contain an error code. // If there's a failover while we're running a dbhash check, the elected secondary might // not have set the tenantMigrationDonorAllowsNonTimestampedReads failpoint, which means // that the listCollections command run when we call CollInfos would throw a // TenantMigrationCommitted error. // If there's a failover as we're creating a ReplSetTest from either the donor or // recipient URLs, it's possible to get back a NotYetInitialized error, so we want to // retry creating the ReplSetTest. // TODO (SERVER-54026): Remove check for error message once the shell correctly // propagates the error code.