diff options
author | Matt Broadstone <mbroadst@mongodb.com> | 2022-09-14 23:05:50 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-15 00:19:47 +0000 |
commit | 1a13031f7cdfb6cffdcff212edef0790fe084df2 (patch) | |
tree | 8d6ba207b94133d0775d398c3384380dfcc8343a /jstests/replsets/tenant_migration_recipient_initial_sync_recovery.js | |
parent | d1da149077ea312efc80f8836bc79f2b1b10c1ad (diff) | |
download | mongo-1a13031f7cdfb6cffdcff212edef0790fe084df2.tar.gz |
SERVER-65315 Enforce mutual exclusion between serverless operations
Diffstat (limited to 'jstests/replsets/tenant_migration_recipient_initial_sync_recovery.js')
-rw-r--r-- | jstests/replsets/tenant_migration_recipient_initial_sync_recovery.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/jstests/replsets/tenant_migration_recipient_initial_sync_recovery.js b/jstests/replsets/tenant_migration_recipient_initial_sync_recovery.js index 404bf0fa765..a0fc1bfacb3 100644 --- a/jstests/replsets/tenant_migration_recipient_initial_sync_recovery.js +++ b/jstests/replsets/tenant_migration_recipient_initial_sync_recovery.js @@ -6,6 +6,7 @@ * incompatible_with_macos, * incompatible_with_shard_merge, * incompatible_with_windows_tls, + * requires_fcv_62, * requires_majority_read_concern, * requires_persistence, * serverless, @@ -19,6 +20,7 @@ load("jstests/libs/fail_point_util.js"); load("jstests/libs/uuid_util.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()}); @@ -59,7 +61,8 @@ recipientRst.awaitReplication(); stopServerReplication(initialSyncNode); const configRecipientsColl = initialSyncNode.getCollection(TenantMigrationTest.kConfigRecipientsNS); -const recipientDoc = configRecipientsColl.findOne({tenantId: kTenantId}); +assert.lte(configRecipientsColl.count(), 1); +const recipientDoc = configRecipientsColl.findOne(); if (recipientDoc) { switch (recipientDoc.state) { case TenantMigrationTest.RecipientState.kStarted: @@ -97,6 +100,13 @@ if (recipientDoc) { } } +const activeServerlessLock = getServerlessOperationLock(initialSyncNode); +if (recipientDoc && !recipientDoc.expireAt) { + assert.eq(activeServerlessLock, ServerlessLockType.TenantMigrationRecipient); +} else { + assert.eq(activeServerlessLock, null); +} + restartServerReplication(initialSyncNode); tenantMigrationTest.stop(); |