summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_builds_coordinator.cpp
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2021-09-03 19:11:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-08 07:54:48 +0000
commitc90f38192378c8526354465991830524eda90c1f (patch)
tree73ce6a76f4dc6f8eaa206309becf5881aaf20a32 /src/mongo/db/index_builds_coordinator.cpp
parenta0a0d7eecccf38f028a77c4cc8b0f13f8673f675 (diff)
downloadmongo-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.cpp6
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()) {