summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2022-08-04 22:41:13 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-04 23:55:47 +0000
commit441237232383286003f6cf231889fffe93225317 (patch)
treedd18a5f131766f001862f18e9e403db33baed807
parent17d9615fdfa2d2b931d241bf1bfe97eaaf812816 (diff)
downloadmongo-441237232383286003f6cf231889fffe93225317.tar.gz
Revert "SERVER-68456 Implement a `dumpState` method within the range deleter service"
This reverts commit adf581022aee1defe88b9fab1e801597848b387c.
-rw-r--r--src/mongo/db/s/range_deleter_service.cpp13
-rw-r--r--src/mongo/db/s/range_deleter_service.h6
-rw-r--r--src/mongo/db/s/range_deleter_service_test.cpp41
3 files changed, 0 insertions, 60 deletions
diff --git a/src/mongo/db/s/range_deleter_service.cpp b/src/mongo/db/s/range_deleter_service.cpp
index bdd6dcb5fce..6d84e423d83 100644
--- a/src/mongo/db/s/range_deleter_service.cpp
+++ b/src/mongo/db/s/range_deleter_service.cpp
@@ -91,19 +91,6 @@ void RangeDeleterService::onStepDown() {
_state.store(kDown);
}
-BSONObj RangeDeleterService::dumpState() {
- auto lock = _acquireMutexUnconditionally();
-
- BSONObjBuilder builder;
- for (const auto& [collUUID, chunkRanges] : _rangeDeletionTasks) {
- BSONArrayBuilder subBuilder(builder.subarrayStart(collUUID.toString()));
- for (const auto& chunkRange : chunkRanges) {
- subBuilder.append(chunkRange->toBSON());
- }
- }
- return builder.obj();
-}
-
SharedSemiFuture<void> RangeDeleterService::registerTask(
const RangeDeletionTask& rdt, SemiFuture<void>&& waitForActiveQueriesToComplete) {
diff --git a/src/mongo/db/s/range_deleter_service.h b/src/mongo/db/s/range_deleter_service.h
index 75e2c4dd655..78c6a83e5b4 100644
--- a/src/mongo/db/s/range_deleter_service.h
+++ b/src/mongo/db/s/range_deleter_service.h
@@ -145,12 +145,6 @@ public:
void onStepUpComplete(OperationContext* opCtx, long long term) override;
void onStepDown() override;
- /*
- * Returns the RangeDeleterService state with the following schema:
- * {collectionUUIDA: [{min: x, max: y}, {min: w, max: z}....], collectionUUIDB: ......}
- */
- BSONObj dumpState();
-
private:
/* Asynchronously register range deletions on the service. To be called on on step-up */
void _recoverRangeDeletionsOnStepUp();
diff --git a/src/mongo/db/s/range_deleter_service_test.cpp b/src/mongo/db/s/range_deleter_service_test.cpp
index e0546180cf6..dbb9f5d7120 100644
--- a/src/mongo/db/s/range_deleter_service_test.cpp
+++ b/src/mongo/db/s/range_deleter_service_test.cpp
@@ -485,45 +485,4 @@ TEST_F(RangeDeleterServiceTest, GetOverlappingRangeDeletionsResilientToRefineSha
futureReadyWhenTasks0And10And30Ready.get(opCtx);
}
-TEST_F(RangeDeleterServiceTest, DumpState) {
- auto rds = RangeDeleterService::get(opCtx);
- auto* task0WithOngoingQueriesCollA = &rangeDeletionTask0ForCollA;
- auto* task1WithOngoingQueriesCollA = &rangeDeletionTask1ForCollA;
- auto* taskWithOngoingQueriesCollB = &rangeDeletionTask0ForCollB;
-
- // Register 2 tasks for `collA` and 1 task for `collB`
- auto completionFuture0CollA =
- rds->registerTask(task0WithOngoingQueriesCollA->getTask(),
- task0WithOngoingQueriesCollA->getOngoingQueriesFuture());
- auto completionFuture1CollA =
- rds->registerTask(task1WithOngoingQueriesCollA->getTask(),
- task1WithOngoingQueriesCollA->getOngoingQueriesFuture());
- auto completionFutureCollB =
- rds->registerTask(taskWithOngoingQueriesCollB->getTask(),
- taskWithOngoingQueriesCollB->getOngoingQueriesFuture());
-
- // The tasks can't be processed (hence completed) before ongoing queries drain
- ASSERT(!completionFuture0CollA.isReady());
- ASSERT(!completionFuture1CollA.isReady());
- ASSERT(!completionFutureCollB.isReady());
- ASSERT_EQ(2, rds->getNumRangeDeletionTasksForCollection(uuidCollA));
- ASSERT_EQ(1, rds->getNumRangeDeletionTasksForCollection(uuidCollB));
-
- // Build expected state and compare it with the returned one from
- // RangeDeleterService::dumpState()
- BSONArrayBuilder builderArrCollA;
- builderArrCollA.append(task0WithOngoingQueriesCollA->getTask().getRange().toBSON());
- builderArrCollA.append(task1WithOngoingQueriesCollA->getTask().getRange().toBSON());
-
- BSONArrayBuilder builderArrCollB;
- builderArrCollB.append(taskWithOngoingQueriesCollB->getTask().getRange().toBSON());
-
- BSONObj expectedState =
- BSON(uuidCollA.toString() << builderArrCollA.arr() << uuidCollB.toString()
- << builderArrCollB.arr());
-
- BSONObj state = rds->dumpState();
- ASSERT_EQ(state.woCompare(expectedState), 0);
-}
-
} // namespace mongo