summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/range_deleter_service.cpp
diff options
context:
space:
mode:
authorSilvia Surroca <silvia.surroca@mongodb.com>2022-08-22 10:24:46 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-22 10:54:04 +0000
commit5518f4e3de045cf3cbbd01d1d4a98dfa5939517c (patch)
tree6410b18236644716235004a73d283db6e16189f8 /src/mongo/db/s/range_deleter_service.cpp
parent02276ba2c720ae0060224df0348e08c31be764d5 (diff)
downloadmongo-5518f4e3de045cf3cbbd01d1d4a98dfa5939517c.tar.gz
SERVER-68676 Range deleter service must honor `disableResumableRangeDeleter`
Diffstat (limited to 'src/mongo/db/s/range_deleter_service.cpp')
-rw-r--r--src/mongo/db/s/range_deleter_service.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mongo/db/s/range_deleter_service.cpp b/src/mongo/db/s/range_deleter_service.cpp
index 36e946dd516..41c2b2f27c2 100644
--- a/src/mongo/db/s/range_deleter_service.cpp
+++ b/src/mongo/db/s/range_deleter_service.cpp
@@ -83,6 +83,12 @@ void RangeDeleterService::onStepUpComplete(OperationContext* opCtx, long long te
}
void RangeDeleterService::_recoverRangeDeletionsOnStepUp() {
+
+ if (disableResumableRangeDeleter.load()) {
+ _state.store(kDown);
+ return;
+ }
+
// TODO SERVER-68348 Asynchronously register tasks on the range deleter service on step-up
_state.store(kUp);
}
@@ -116,6 +122,14 @@ BSONObj RangeDeleterService::dumpState() {
SharedSemiFuture<void> RangeDeleterService::registerTask(
const RangeDeletionTask& rdt, SemiFuture<void>&& waitForActiveQueriesToComplete) {
+ if (disableResumableRangeDeleter.load()) {
+ return SemiFuture<void>::makeReady(
+ Status(ErrorCodes::ResumableRangeDeleterDisabled,
+ "Not submitting any range deletion task because the "
+ "disableResumableRangeDeleter server parameter is set to true"))
+ .share();
+ }
+
// Block the scheduling of the task while populating internal data structures
SharedPromise<void> blockUntilRegistered;
@@ -204,6 +218,15 @@ int RangeDeleterService::getNumRangeDeletionTasksForCollection(const UUID& colle
SharedSemiFuture<void> RangeDeleterService::getOverlappingRangeDeletionsFuture(
const UUID& collectionUUID, const ChunkRange& range) {
+
+ if (disableResumableRangeDeleter.load()) {
+ return SemiFuture<void>::makeReady(
+ Status(ErrorCodes::ResumableRangeDeleterDisabled,
+ "Not submitting any range deletion task because the "
+ "disableResumableRangeDeleter server parameter is set to true"))
+ .share();
+ }
+
auto lock = _acquireMutexFailIfServiceNotUp();
auto mapEntry = _rangeDeletionTasks.find(collectionUUID);