jstests/replsets/tenant_migration_recipient_initial_sync_cloning.js
//    allows the migration to complete.
allows the migration to complete.
allows the migration to complete .
function runTestCase(tenantId, recipientFailpoint, checkMtab, restartNodeAndCheckStateFunction) {
    const donorRst = new ReplSetTest({
        name: "donorRst",
        nodes: 1,
        nodeOptions: Object.assign(migrationX509Options.donor, {
            setParameter: {
                'failpoint.tenantMigrationDonorAllowsNonTimestampedReads':
                    tojson({mode: 'alwaysOn'}),
            }
        })
    });
    donorRst.startSet();
    donorRst.initiate();
    const tenantMigrationTest = new TenantMigrationTest({
        name: jsTestName(),
        donorRst,
        sharedOptions: {setParameter: {tenantApplierBatchSizeOps: 2}}
    });
    const migrationOpts = {migrationIdString: extractUUIDFromObject(UUID()), tenantId: tenantId};
    const dbName = tenantMigrationTest.tenantDB(tenantId, testDBName);
    const originalRecipientPrimary = tenantMigrationTest.getRecipientPrimary();
    const fpOnRecipient =
        configureFailPoint(originalRecipientPrimary, recipientFailpoint, {action: "hang"});
    tenantMigrationTest.insertDonorDB(dbName, testCollName);
    jsTestLog(`Starting a tenant migration with migrationID ${
        migrationOpts.migrationIdString}, and tenantId ${tenantId}`);
    assert.commandWorked(tenantMigrationTest.startMigration(migrationOpts));
    restartNodeAndCheckStateFunction(tenantId, tenantMigrationTest, checkMtab, fpOnRecipient);
    jsTestLog("Allowing migration to run to completion.");
    TenantMigrationTest.assertCommitted(
        tenantMigrationTest.waitForMigrationToComplete(migrationOpts));
    assert.commandWorked(tenantMigrationTest.forgetMigration(migrationOpts.migrationIdString));
    tenantMigrationTest.stop();
    donorRst.stopSet();
}
function runTestCase ( tenantId , recipientFailpoint , checkMtab , restartNodeAndCheckStateFunction ) { const donorRst = new ReplSetTest ( { name : "donorRst" , nodes : 1 , nodeOptions : Object . assign ( migrationX509Options . donor , { setParameter : { 'failpoint.tenantMigrationDonorAllowsNonTimestampedReads' : tojson ( { mode : 'alwaysOn' } ) , } } ) } ) ; donorRst . startSet ( ) ; donorRst . initiate ( ) ; const tenantMigrationTest = new TenantMigrationTest ( { name : jsTestName ( ) , donorRst , sharedOptions : { setParameter : { tenantApplierBatchSizeOps : 2 } } } ) ; const migrationOpts = { migrationIdString : extractUUIDFromObject ( UUID ( ) ) , tenantId : tenantId } ; const dbName = tenantMigrationTest . tenantDB ( tenantId , testDBName ) ; const originalRecipientPrimary = tenantMigrationTest . getRecipientPrimary ( ) ; const fpOnRecipient = configureFailPoint ( originalRecipientPrimary , recipientFailpoint , { action : "hang" } ) ; tenantMigrationTest . insertDonorDB ( dbName , testCollName ) ; jsTestLog ( ` ${ migrationOpts . migrationIdString } ${ tenantId } ` ) ; assert . commandWorked ( tenantMigrationTest . startMigration ( migrationOpts ) ) ; restartNodeAndCheckStateFunction ( tenantId , tenantMigrationTest , checkMtab , fpOnRecipient ) ; jsTestLog ( "Allowing migration to run to completion." ) ; TenantMigrationTest . assertCommitted ( tenantMigrationTest . waitForMigrationToComplete ( migrationOpts ) ) ; assert . commandWorked ( tenantMigrationTest . forgetMigration ( migrationOpts . migrationIdString ) ) ; tenantMigrationTest . stop ( ) ; donorRst . stopSet ( ) ; }
allows the migration to complete.
allows the migration to complete .
// Allow non-timestamped reads on donor after migration completes for testing. // Allow the migration to run to completion.