jstests/replsets/tenant_migration_concurrent_writes_on_donor.js
/**
 * Tests that the donor rejects writes after the migration commits.
 */
Tests that the donor rejects writes after the migration commits.
Tests that the donor rejects writes after the migration commits .
function testRejectWritesAfterMigrationCommitted(testCase, testOpts) {
    const tenantId = testOpts.dbName.split('_')[0];
    const migrationOpts = {
        migrationIdString: extractUUIDFromObject(UUID()),
        tenantId,
    };
    TenantMigrationTest.assertCommitted(tenantMigrationTest.runMigration(migrationOpts, {
        retryOnRetryableErrors: false,
        automaticForgetMigration: false,
        enableDonorStartMigrationFsync: true
    }));
    runCommand(testOpts, ErrorCodes.TenantMigrationCommitted);
    testCase.assertCommandFailed(testOpts.primaryDB, testOpts.dbName, testOpts.collName);
    checkTenantMigrationAccessBlocker(
        testOpts.primaryDB, tenantId, {numTenantMigrationCommittedErrors: 1});
    assert.commandWorked(tenantMigrationTest.forgetMigration(migrationOpts.migrationIdString));
    tenantMigrationTest.waitForMigrationGarbageCollection(migrationOpts.migrationIdString);
}
function testRejectWritesAfterMigrationCommitted ( testCase , testOpts ) { const tenantId = testOpts . dbName . split ( '_' ) [ 0 ] ; const migrationOpts = { migrationIdString : extractUUIDFromObject ( UUID ( ) ) , tenantId , } ; TenantMigrationTest . assertCommitted ( tenantMigrationTest . runMigration ( migrationOpts , { retryOnRetryableErrors : false , automaticForgetMigration : false , enableDonorStartMigrationFsync : true } ) ) ; runCommand ( testOpts , ErrorCodes . TenantMigrationCommitted ) ; testCase . assertCommandFailed ( testOpts . primaryDB , testOpts . dbName , testOpts . collName ) ; checkTenantMigrationAccessBlocker ( testOpts . primaryDB , tenantId , { numTenantMigrationCommittedErrors : 1 } ) ; assert . commandWorked ( tenantMigrationTest . forgetMigration ( migrationOpts . migrationIdString ) ) ; tenantMigrationTest . waitForMigrationGarbageCollection ( migrationOpts . migrationIdString ) ; }
Tests that the donor rejects writes after the migration commits.
Tests that the donor rejects writes after the migration commits .