jstests/replsets/tenant_migration_recipient_initial_sync_cloning.js
// sync, and steps the restarted node up.
sync, and steps the restarted node up.
sync and steps the restarted node up .
function restartNodeAndCheckStateDuringOplogApplication(
    tenantId, tenantMigrationTest, checkMtab, fpOnRecipient) {
    fpOnRecipient.wait();
    const originalRecipientPrimary = tenantMigrationTest.getRecipientPrimary();
    const fpPauseOplogApplierOnBatch =
        configureFailPoint(originalRecipientPrimary, "fpBeforeTenantOplogApplyingBatch");
    tenantMigrationTest.insertDonorDB(
        tenantMigrationTest.tenantDB(tenantId, testDBName),
        testCollName,
        [...Array(30).keys()].map((i) => ({a: i, b: "George Harrison - All Things Must Pass"})));
    fpPauseOplogApplierOnBatch.wait();
    const initialSyncNode = restartNodeAndCheckState(tenantId, tenantMigrationTest, checkMtab);
    jsTestLog("Stepping up the new node.");
    assert.commandWorked(initialSyncNode.adminCommand({"replSetStepUp": 1}));
    fpPauseOplogApplierOnBatch.off();
    fpOnRecipient.off();
}
function restartNodeAndCheckStateDuringOplogApplication ( tenantId , tenantMigrationTest , checkMtab , fpOnRecipient ) { fpOnRecipient . wait ( ) ; const originalRecipientPrimary = tenantMigrationTest . getRecipientPrimary ( ) ; const fpPauseOplogApplierOnBatch = configureFailPoint ( originalRecipientPrimary , "fpBeforeTenantOplogApplyingBatch" ) ; tenantMigrationTest . insertDonorDB ( tenantMigrationTest . tenantDB ( tenantId , testDBName ) , testCollName , [ ... Array ( 30 ) . keys ( ) ] . map ( ( i ) => ( { a : i , b : "George Harrison - All Things Must Pass" } ) ) ) ; fpPauseOplogApplierOnBatch . wait ( ) ; const initialSyncNode = restartNodeAndCheckState ( tenantId , tenantMigrationTest , checkMtab ) ; jsTestLog ( "Stepping up the new node." ) ; assert . commandWorked ( initialSyncNode . adminCommand ( { "replSetStepUp" : 1 } ) ) ; fpPauseOplogApplierOnBatch . off ( ) ; fpOnRecipient . off ( ) ; }
sync, and steps the restarted node up.
sync and steps the restarted node up .
// Pause the tenant oplog applier before applying a batch. // Insert documents into the donor after data cloning but before tenant oplog application, so // that the recipient has entries to apply during tenant oplog application. // Wait until the oplog applier has started and is trying to apply a batch. Then restart a node. // Now step up the new node