diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2021-09-03 19:11:40 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-08 07:54:48 +0000 |
commit | c90f38192378c8526354465991830524eda90c1f (patch) | |
tree | 73ce6a76f4dc6f8eaa206309becf5881aaf20a32 /src/mongo/db/index_builds_coordinator.cpp | |
parent | a0a0d7eecccf38f028a77c4cc8b0f13f8673f675 (diff) | |
download | mongo-c90f38192378c8526354465991830524eda90c1f.tar.gz |
SERVER-59782 migrate makeGuard calls to ScopeGuard
Diffstat (limited to 'src/mongo/db/index_builds_coordinator.cpp')
-rw-r--r-- | src/mongo/db/index_builds_coordinator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp index cb1f3252884..18ca33e224b 100644 --- a/src/mongo/db/index_builds_coordinator.cpp +++ b/src/mongo/db/index_builds_coordinator.cpp @@ -1578,7 +1578,7 @@ void IndexBuildsCoordinator::createIndex(OperationContext* opCtx, throw; } - auto abortOnExit = makeGuard([&] { + ScopeGuard abortOnExit([&] { _indexBuildsManager.abortIndexBuild( opCtx, collection, buildUUID, MultiIndexBlock::kNoopOnCleanUpFn); }); @@ -2329,7 +2329,7 @@ void IndexBuildsCoordinator::_scanCollectionAndInsertSortedKeysIntoIndex( // Collection scan and insert into index. { - auto scopeGuard = makeGuard([&] { + ScopeGuard scopeGuard([&] { opCtx->recoveryUnit()->setTimestampReadSource(RecoveryUnit::ReadSource::kNoTimestamp); }); @@ -2504,7 +2504,7 @@ IndexBuildsCoordinator::CommitResult IndexBuildsCoordinator::_insertKeysFromSide // While we are still holding the RSTL and before returning, ensure the metrics collected for // this index build are attributed to the primary that commits or aborts the index build. - auto metricsGuard = makeGuard([&]() { + ScopeGuard metricsGuard([&]() { auto& collector = ResourceConsumption::MetricsCollector::get(opCtx); bool wasCollecting = collector.endScopedCollecting(); if (!isPrimary || !wasCollecting || !ResourceConsumption::isMetricsAggregationEnabled()) { |