diff options
author | Louis Williams <louis.williams@mongodb.com> | 2022-05-30 14:36:50 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-30 15:02:43 +0000 |
commit | 600e8b6e84372f490dc4cdafce4bd5ef241e7072 (patch) | |
tree | 7c9ff10accba78ce7462368540bce3f5bf41f453 /src/mongo/db/pipeline | |
parent | 89700662ef561bb043615b8bffd4f5316efbea07 (diff) | |
download | mongo-600e8b6e84372f490dc4cdafce4bd5ef241e7072.tar.gz |
SERVER-66718 Allow StorageInterfaceImpl to perform more clustered collection scans
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r-- | src/mongo/db/pipeline/change_stream_expired_pre_image_remover.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/mongo/db/pipeline/change_stream_expired_pre_image_remover.cpp b/src/mongo/db/pipeline/change_stream_expired_pre_image_remover.cpp index 4a2c7f46542..5be57605e9d 100644 --- a/src/mongo/db/pipeline/change_stream_expired_pre_image_remover.cpp +++ b/src/mongo/db/pipeline/change_stream_expired_pre_image_remover.cpp @@ -358,30 +358,31 @@ void deleteExpiredChangeStreamPreImages(Client* client, Date_t currentTimeForTim opCtx.get(), currentTimeForTimeBasedExpiration)); for (const auto& collectionRange : expiredPreImages) { - writeConflictRetry(opCtx.get(), - "ChangeStreamExpiredPreImagesRemover", - NamespaceString::kChangeStreamPreImagesNamespace.ns(), - [&] { - auto params = std::make_unique<DeleteStageParams>(); - params->isMulti = true; - - std::unique_ptr<BatchedDeleteStageParams> batchedDeleteParams; - if (isBatchedRemoval) { - batchedDeleteParams = - std::make_unique<BatchedDeleteStageParams>(); - } - - auto exec = InternalPlanner::deleteWithCollectionScan( - opCtx.get(), - &preImagesColl, - std::move(params), - PlanYieldPolicy::YieldPolicy::YIELD_AUTO, - InternalPlanner::Direction::FORWARD, - RecordIdBound(collectionRange.first), - RecordIdBound(collectionRange.second), - std::move(batchedDeleteParams)); - numberOfRemovals += exec->executeDelete(); - }); + writeConflictRetry( + opCtx.get(), + "ChangeStreamExpiredPreImagesRemover", + NamespaceString::kChangeStreamPreImagesNamespace.ns(), + [&] { + auto params = std::make_unique<DeleteStageParams>(); + params->isMulti = true; + + std::unique_ptr<BatchedDeleteStageParams> batchedDeleteParams; + if (isBatchedRemoval) { + batchedDeleteParams = std::make_unique<BatchedDeleteStageParams>(); + } + + auto exec = InternalPlanner::deleteWithCollectionScan( + opCtx.get(), + &preImagesColl, + std::move(params), + PlanYieldPolicy::YieldPolicy::YIELD_AUTO, + InternalPlanner::Direction::FORWARD, + RecordIdBound(collectionRange.first), + RecordIdBound(collectionRange.second), + CollectionScanParams::ScanBoundInclusion::kIncludeBothStartAndEndRecords, + std::move(batchedDeleteParams)); + numberOfRemovals += exec->executeDelete(); + }); } if (numberOfRemovals > 0) { |