summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@mongodb.com>2021-11-11 21:20:37 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-12-17 00:51:03 +0000
commit19ce15702241d2ee0cad9cb30cb7f2fed072db25 (patch)
tree3df446ddab2231cba5c3b6e86956cdd1d6294567 /jstests
parent7abd35a7a1721c9ed43e3a3961cd93b0421a4010 (diff)
downloadmongo-19ce15702241d2ee0cad9cb30cb7f2fed072db25.tar.gz
SERVER-61143 Import copied files for Shard Merge
Also SERVER-61138 and SERVER-61139.
Diffstat (limited to 'jstests')
-rw-r--r--jstests/replsets/tenant_migration_file_import.js (renamed from jstests/replsets/tenant_migration_rollback_to_stable.js)22
1 files changed, 19 insertions, 3 deletions
diff --git a/jstests/replsets/tenant_migration_rollback_to_stable.js b/jstests/replsets/tenant_migration_file_import.js
index 8122f6f20ca..2cb76ce54a6 100644
--- a/jstests/replsets/tenant_migration_rollback_to_stable.js
+++ b/jstests/replsets/tenant_migration_file_import.js
@@ -20,11 +20,16 @@
(function() {
"use strict";
+// TODO (SERVER-61144): Recipient secondaries don't import donor files yet, so dbhash will mismatch.
+TestData.skipCheckDBHashes = true;
+
load("jstests/libs/uuid_util.js");
load("jstests/replsets/libs/tenant_migration_test.js");
const migrationId = UUID();
-const tenantMigrationTest = new TenantMigrationTest({name: jsTestName()});
+// TODO (SERVER-61773): Don't set minSnapshotHistoryWindowInSeconds.
+const tenantMigrationTest = new TenantMigrationTest(
+ {name: jsTestName(), sharedOptions: {setParameter: {minSnapshotHistoryWindowInSeconds: 0}}});
const donorPrimary = tenantMigrationTest.getDonorPrimary();
const recipientPrimary = tenantMigrationTest.getRecipientPrimary();
const kDataDir =
@@ -82,13 +87,24 @@ donorPrimary.adminCommand({killCursors: "$cmd.aggregate", cursors: [cursor.id]})
})();
jsTestLog("Run migration");
+// The old multitenant migrations won't copy myDatabase since it doesn't start with testTenantId,
+// but shard merge copies everything so we still expect myDatabase on the recipient, below.
const kTenantId = "testTenantId";
const migrationOpts = {
migrationIdString: extractUUIDFromObject(migrationId),
tenantId: kTenantId,
};
TenantMigrationTest.assertCommitted(tenantMigrationTest.runMigration(migrationOpts));
-// Expect an "Opened donor WiredTiger database" message. Requires featureFlagShardMerge.
-checkLog.containsJson(tenantMigrationTest.getRecipientPrimary(), 6113700);
+for (let collectionName of ["myCollection", "myCappedCollection"]) {
+ jsTestLog(`Checking ${collectionName}`);
+ // Use "countDocuments" to check actual docs, "count" to check sizeStorer data.
+ assert.eq(donorPrimary.getDB("myDatabase")[collectionName].countDocuments({}),
+ recipientPrimary.getDB("myDatabase")[collectionName].countDocuments({}),
+ "countDocuments");
+ assert.eq(donorPrimary.getDB("myDatabase")[collectionName].count(),
+ recipientPrimary.getDB("myDatabase")[collectionName].count(),
+ "count");
+}
+
tenantMigrationTest.stop();
})();