summaryrefslogtreecommitdiff
path: root/jstests/replsets/tenant_migration_concurrent_reads_on_recipient.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/replsets/tenant_migration_concurrent_reads_on_recipient.js')
-rw-r--r--jstests/replsets/tenant_migration_concurrent_reads_on_recipient.js28
1 files changed, 8 insertions, 20 deletions
diff --git a/jstests/replsets/tenant_migration_concurrent_reads_on_recipient.js b/jstests/replsets/tenant_migration_concurrent_reads_on_recipient.js
index 70f82a3a2db..761e5967446 100644
--- a/jstests/replsets/tenant_migration_concurrent_reads_on_recipient.js
+++ b/jstests/replsets/tenant_migration_concurrent_reads_on_recipient.js
@@ -91,7 +91,6 @@ function testRejectAllReadsAfterCloningDone({testCase, dbName, collName, tenantM
beforeFetchingTransactionsFp.off();
TenantMigrationTest.assertCommitted(runMigrationThread.returnData());
assert.commandWorked(tenantMigrationTest.forgetMigration(migrationOpts.migrationIdString));
- tenantMigrationTest.waitForMigrationGarbageCollection(migrationOpts.migrationIdString);
}
/**
@@ -171,7 +170,6 @@ function testRejectOnlyReadsWithAtClusterTimeLessThanRejectReadsBeforeTimestamp(
});
assert.commandWorked(tenantMigrationTest.forgetMigration(migrationOpts.migrationIdString));
- tenantMigrationTest.waitForMigrationGarbageCollection(migrationOpts.migrationIdString);
}
/**
@@ -224,7 +222,6 @@ function testDoNotRejectReadsAfterMigrationAbortedBeforeReachingRejectReadsBefor
runCommand(db, testCase.command(collName), null);
}
});
- tenantMigrationTest.waitForMigrationGarbageCollection(migrationOpts.migrationIdString);
}
/**
@@ -416,34 +413,25 @@ const testFuncs = {
testDoNotRejectReadsAfterMigrationAbortedAfterReachingRejectReadsBeforeTimestamp
};
-const tenantMigrationTest = new TenantMigrationTest({
- name: jsTestName(),
- quickGarbageCollection: true,
-});
for (const [testName, testFunc] of Object.entries(testFuncs)) {
for (const [testCaseName, testCase] of Object.entries(testCases)) {
jsTest.log("Testing " + testName + " with testCase " + testCaseName);
let tenantId = `${testCaseName}-${testName}`;
- let migrationDb = `${tenantId}_test`;
- tenantMigrationTest.insertDonorDB(migrationDb, "test");
let dbName = `${tenantId}_${kTenantDefinedDbName}`;
+ const tenantMigrationTest = new TenantMigrationTest({
+ name: jsTestName(),
+ quickGarbageCollection: true,
+ insertDataForTenant: tenantId,
+ });
- // Force the recipient to preserve all snapshot history to ensure that snapshot reads do
- // not fail with SnapshotTooOld due to snapshot being unavailable.
+ // Force the recipient to preserve all snapshot history to ensure that snapshot reads do not
+ // fail with SnapshotTooOld due to snapshot being unavailable.
tenantMigrationTest.getRecipientRst().nodes.forEach(node => {
configureFailPoint(node, "WTPreserveSnapshotHistoryIndefinitely");
});
testFunc({testCase, dbName, collName: kCollName, tenantMigrationTest});
-
- // ShardMerge is not robust to migrating the twice in quick succession. We drop the data
- // files to ensure a subsequent tenant migration will avoid trying to merge files from the
- // previous migration.
- assert.commandWorked(
- tenantMigrationTest.getDonorRst().getPrimary().getDB(migrationDb).dropDatabase());
- assert.commandWorked(
- tenantMigrationTest.getRecipientRst().getPrimary().getDB(migrationDb).dropDatabase());
+ tenantMigrationTest.stop();
}
}
-tenantMigrationTest.stop();
})();