summaryrefslogtreecommitdiff
path: root/jstests/replsets/tenant_migration_donor_startup_recovery.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/replsets/tenant_migration_donor_startup_recovery.js')
-rw-r--r--jstests/replsets/tenant_migration_donor_startup_recovery.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/jstests/replsets/tenant_migration_donor_startup_recovery.js b/jstests/replsets/tenant_migration_donor_startup_recovery.js
index 7a564e416a5..7dbbcb56f8c 100644
--- a/jstests/replsets/tenant_migration_donor_startup_recovery.js
+++ b/jstests/replsets/tenant_migration_donor_startup_recovery.js
@@ -8,6 +8,7 @@
* incompatible_with_macos,
* incompatible_with_shard_merge,
* incompatible_with_windows_tls,
+ * requires_fcv_62,
* requires_majority_read_concern,
* requires_persistence,
* serverless,
@@ -20,6 +21,7 @@
load("jstests/libs/fail_point_util.js");
load("jstests/libs/uuid_util.js");
load("jstests/replsets/libs/tenant_migration_test.js");
+const {ServerlessLockType, getServerlessOperationLock} = TenantMigrationUtil;
const donorRst = new ReplSetTest({
nodes: 1,
@@ -70,7 +72,8 @@ donorRst.startSet({
donorPrimary = donorRst.getPrimary();
const configDonorsColl = donorPrimary.getCollection(TenantMigrationTest.kConfigDonorsNS);
-const donorDoc = configDonorsColl.findOne({tenantId: kTenantId});
+assert.lte(configDonorsColl.count(), 1);
+const donorDoc = configDonorsColl.findOne();
if (donorDoc) {
switch (donorDoc.state) {
case TenantMigrationTest.DonorState.kAbortingIndexBuilds:
@@ -133,6 +136,13 @@ if (donorDoc) {
}
}
+const activeServerlessLock = getServerlessOperationLock(donorPrimary);
+if (donorDoc && !donorDoc.expireAt) {
+ assert.eq(activeServerlessLock, ServerlessLockType.TenantMigrationDonor);
+} else {
+ assert.eq(activeServerlessLock, ServerlessLockType.None);
+}
+
tenantMigrationTest.stop();
donorRst.stopSet();
})();