diff options
Diffstat (limited to 'jstests/replsets/tenant_migration_donor_initial_sync_recovery.js')
-rw-r--r-- | jstests/replsets/tenant_migration_donor_initial_sync_recovery.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/jstests/replsets/tenant_migration_donor_initial_sync_recovery.js b/jstests/replsets/tenant_migration_donor_initial_sync_recovery.js index 85429af3ddd..8afc2d2fcf9 100644 --- a/jstests/replsets/tenant_migration_donor_initial_sync_recovery.js +++ b/jstests/replsets/tenant_migration_donor_initial_sync_recovery.js @@ -5,6 +5,7 @@ * @tags: [ * incompatible_with_macos, * incompatible_with_windows_tls, + * requires_fcv_62, * requires_majority_read_concern, * requires_persistence, * serverless, @@ -19,6 +20,7 @@ load("jstests/libs/uuid_util.js"); load("jstests/libs/parallelTester.js"); load("jstests/libs/write_concern_util.js"); load("jstests/replsets/libs/tenant_migration_test.js"); +const {ServerlessLockType, getServerlessOperationLock} = TenantMigrationUtil; const tenantMigrationTest = new TenantMigrationTest({name: jsTestName()}); @@ -47,6 +49,7 @@ const migrationOpts = { migrationIdString: extractUUIDFromObject(UUID()), tenantId: kTenantId }; + assert.commandWorked(tenantMigrationTest.startMigration(migrationOpts)); // We must wait for the migration to have finished replicating the recipient keys on the donor set // before starting initial sync, otherwise the migration will hang while waiting for initial sync to @@ -83,7 +86,8 @@ donorRst.awaitReplication(); stopServerReplication(initialSyncNode); let configDonorsColl = initialSyncNode.getCollection(TenantMigrationTest.kConfigDonorsNS); -let donorDoc = configDonorsColl.findOne({tenantId: kTenantId}); +assert.lte(configDonorsColl.count(), 1); +let donorDoc = configDonorsColl.findOne(); if (donorDoc) { jsTestLog("Initial sync completed while migration was in state: " + donorDoc.state); switch (donorDoc.state) { @@ -148,6 +152,13 @@ if (donorDoc) { } } +const activeServerlessLock = getServerlessOperationLock(initialSyncNode); +if (donorDoc && !donorDoc.expireAt) { + assert.eq(activeServerlessLock, ServerlessLockType.TenantMigrationDonor); +} else { + assert.eq(activeServerlessLock, ServerlessLockType.None); +} + if (fp) { fp.off(); } |