summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Caplinger <christopher.caplinger@mongodb.com>2022-06-22 14:15:35 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-06-22 14:50:01 +0000
commit09f7596e084c12ffe154f9e8466d1239b5efe389 (patch)
tree0e8e6e7e4b9671be94caa3738f6654f29099bd51
parente2d8053e518259c1df27211281a7cfa697dfaa12 (diff)
downloadmongo-09f7596e084c12ffe154f9e8466d1239b5efe389.tar.gz
SERVER-67334: Pass tenantId directly to onCommit hook
-rw-r--r--src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp9
1 files changed, 4 insertions, 5 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 79fa28313f4..26f8d75ba3c 100644
--- a/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp
+++ b/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp
@@ -288,11 +288,11 @@ void TenantMigrationRecipientOpObserver::onDelete(OperationContext* opCtx,
if (nss == NamespaceString::kTenantMigrationRecipientsNamespace &&
!tenant_migration_access_blocker::inRecoveryMode(opCtx)) {
if (tenantIdToDeleteDecoration(opCtx)) {
+ auto tenantId = tenantIdToDeleteDecoration(opCtx).get();
LOGV2_INFO(8423337, "Removing expired 'multitenant migration' migration");
- opCtx->recoveryUnit()->onCommit([opCtx](boost::optional<Timestamp>) {
+ opCtx->recoveryUnit()->onCommit([opCtx, tenantId](boost::optional<Timestamp>) {
TenantMigrationAccessBlockerRegistry::get(opCtx->getServiceContext())
- .remove(tenantIdToDeleteDecoration(opCtx).get(),
- TenantMigrationAccessBlocker::BlockerType::kRecipient);
+ .remove(tenantId, TenantMigrationAccessBlocker::BlockerType::kRecipient);
});
}
@@ -302,8 +302,7 @@ void TenantMigrationRecipientOpObserver::onDelete(OperationContext* opCtx,
"Removing expired 'shard merge' migration",
"migrationId"_attr = migrationId);
TenantMigrationAccessBlockerRegistry::get(opCtx->getServiceContext())
- .removeRecipientAccessBlockersForMigration(
- migrationIdToDeleteDecoration(opCtx).get());
+ .removeRecipientAccessBlockersForMigration(migrationId);
repl::TenantFileImporterService::get(opCtx->getServiceContext())->reset(migrationId);
}
}