summaryrefslogtreecommitdiff
path: root/src/mongo/db/serverless
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2023-02-10 14:35:56 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-22 20:50:53 +0000
commitdab496ed148b2b5895780e6fd4208bddae2424c5 (patch)
tree3e72d2a1ac546e6be9a72880e1511a205c5565cb /src/mongo/db/serverless
parent8bea11983310ab5be581d59bd84573a2089c8825 (diff)
downloadmongo-dab496ed148b2b5895780e6fd4208bddae2424c5.tar.gz
SERVER-73873 Remove opCtx captures from onCommit/onRollback handlers
Diffstat (limited to 'src/mongo/db/serverless')
-rw-r--r--src/mongo/db/serverless/shard_split_donor_op_observer.cpp7
-rw-r--r--src/mongo/db/serverless/shard_split_donor_service.cpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/serverless/shard_split_donor_op_observer.cpp b/src/mongo/db/serverless/shard_split_donor_op_observer.cpp
index 15b14508d24..39bc9955de2 100644
--- a/src/mongo/db/serverless/shard_split_donor_op_observer.cpp
+++ b/src/mongo/db/serverless/shard_split_donor_op_observer.cpp
@@ -162,7 +162,8 @@ void onTransitionToAbortingIndexBuilds(OperationContext* opCtx,
if (isPrimary(opCtx)) {
// onRollback is not registered on secondaries since secondaries should not fail to
// apply the write.
- opCtx->recoveryUnit()->onRollback([opCtx, migrationId = donorStateDoc.getId()] {
+ opCtx->recoveryUnit()->onRollback([migrationId =
+ donorStateDoc.getId()](OperationContext* opCtx) {
TenantMigrationAccessBlockerRegistry::get(opCtx->getServiceContext())
.removeAccessBlockersForMigration(
migrationId, TenantMigrationAccessBlocker::BlockerType::kDonor);
@@ -397,7 +398,7 @@ void ShardSplitDonorOpObserver::onDelete(OperationContext* opCtx,
return;
}
- opCtx->recoveryUnit()->onCommit([opCtx](boost::optional<Timestamp>) {
+ opCtx->recoveryUnit()->onCommit([](OperationContext* opCtx, boost::optional<Timestamp>) {
// Donor access blockers are removed from donor nodes via the shard split op observer.
// Donor access blockers are removed from recipient nodes when the node applies the
// recipient config. When the recipient primary steps up it will delete its state
@@ -421,7 +422,7 @@ repl::OpTime ShardSplitDonorOpObserver::onDropCollection(OperationContext* opCtx
std::uint64_t numRecords,
const CollectionDropType dropType) {
if (collectionName == NamespaceString::kShardSplitDonorsNamespace) {
- opCtx->recoveryUnit()->onCommit([opCtx](boost::optional<Timestamp>) {
+ opCtx->recoveryUnit()->onCommit([](OperationContext* opCtx, boost::optional<Timestamp>) {
TenantMigrationAccessBlockerRegistry::get(opCtx->getServiceContext())
.removeAll(TenantMigrationAccessBlocker::BlockerType::kDonor);
diff --git a/src/mongo/db/serverless/shard_split_donor_service.cpp b/src/mongo/db/serverless/shard_split_donor_service.cpp
index afa630bc9d8..a0e60637509 100644
--- a/src/mongo/db/serverless/shard_split_donor_service.cpp
+++ b/src/mongo/db/serverless/shard_split_donor_service.cpp
@@ -906,7 +906,7 @@ ExecutorFuture<repl::OpTime> ShardSplitDonorService::DonorStateMachine::_updateS
mtab->startBlockingWrites();
opCtx->recoveryUnit()->onRollback(
- [mtab] { mtab->rollBackStartBlocking(); });
+ [mtab](OperationContext*) { mtab->rollBackStartBlocking(); });
}
// Reserve an opTime for the write.