From f79b80bee2792f829aa1e6a2aef847b27f34ed23 Mon Sep 17 00:00:00 2001 From: Didier Nadeau Date: Tue, 16 May 2023 12:41:45 +0000 Subject: SERVER-72370 Fix incorrect serverless lock usage in Tenant Migration --- src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp b/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp index 86ca883159a..a0bf050ec34 100644 --- a/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp +++ b/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp @@ -127,12 +127,12 @@ void TenantMigrationRecipientOpObserver::onInserts( ServerlessOperationLockRegistry::get(opCtx->getServiceContext()) .acquireLock(ServerlessOperationLockRegistry::LockType::kTenantRecipient, recipientStateDoc.getId()); - opCtx->recoveryUnit()->onRollback( - [migrationId = recipientStateDoc.getId()](OperationContext* opCtx) { - ServerlessOperationLockRegistry::get(opCtx->getServiceContext()) - .releaseLock(ServerlessOperationLockRegistry::LockType::kTenantDonor, - migrationId); - }); + opCtx->recoveryUnit()->onRollback([migrationId = recipientStateDoc.getId()]( + OperationContext* opCtx) { + ServerlessOperationLockRegistry::get(opCtx->getServiceContext()) + .releaseLock(ServerlessOperationLockRegistry::LockType::kTenantRecipient, + migrationId); + }); } } } -- cgit v1.2.1