jstests/replsets/tenant_migration_concurrent_reads_on_donor.js
/**
 * Asserts that the TenantMigrationAccessBlocker for the given tenant on the given node has the
 * expected statistics.
 */
Asserts that the TenantMigrationAccessBlocker for the given tenant on the given node has the
expected statistics.
Asserts that the TenantMigrationAccessBlocker for the given tenant on the given node has the expected statistics .
function checkTenantMigrationAccessBlocker(node, tenantId, {
    numBlockedReads = 0,
    numTenantMigrationCommittedErrors = 0,
    numTenantMigrationAbortedErrors = 0
}) {
    const mtab =
        TenantMigrationUtil.getTenantMigrationAccessBlocker({donorNode: node, tenantId}).donor;
    if (!mtab) {
        assert.eq(0, numBlockedReads);
        assert.eq(0, numTenantMigrationCommittedErrors);
        assert.eq(0, numTenantMigrationAbortedErrors);
        return;
    }
    assert.eq(mtab.numBlockedReads, numBlockedReads, tojson(mtab));
    assert.eq(mtab.numBlockedWrites, 0, tojson(mtab));
    assert.eq(
        mtab.numTenantMigrationCommittedErrors, numTenantMigrationCommittedErrors, tojson(mtab));
    assert.eq(mtab.numTenantMigrationAbortedErrors, numTenantMigrationAbortedErrors, tojson(mtab));
}
function checkTenantMigrationAccessBlocker ( node , tenantId , { numBlockedReads = 0 , numTenantMigrationCommittedErrors = 0 , numTenantMigrationAbortedErrors = 0 } ) { const mtab = TenantMigrationUtil . getTenantMigrationAccessBlocker ( { donorNode : node , tenantId } ) . donor ; if ( ! mtab ) { assert . eq ( 0 , numBlockedReads ) ; assert . eq ( 0 , numTenantMigrationCommittedErrors ) ; assert . eq ( 0 , numTenantMigrationAbortedErrors ) ; return ; } assert . eq ( mtab . numBlockedReads , numBlockedReads , tojson ( mtab ) ) ; assert . eq ( mtab . numBlockedWrites , 0 , tojson ( mtab ) ) ; assert . eq ( mtab . numTenantMigrationCommittedErrors , numTenantMigrationCommittedErrors , tojson ( mtab ) ) ; assert . eq ( mtab . numTenantMigrationAbortedErrors , numTenantMigrationAbortedErrors , tojson ( mtab ) ) ; }
Asserts that the TenantMigrationAccessBlocker for the given tenant on the given node has the
 expected statistics.
Asserts that the TenantMigrationAccessBlocker for the given tenant on the given node has the expected statistics .