From 71c42004e0e094a3b6efb3352f516af2b76eda3f Mon Sep 17 00:00:00 2001 From: Pierlauro Sciarelli Date: Wed, 23 Nov 2022 21:11:13 +0000 Subject: SERVER-71122 Get rid of the `WaitForCleanCorrectEvenAfterClearFollowedBySetFilteringMetadata` unit test --- .../db/s/collection_sharding_runtime_test.cpp | 38 ---------------------- 1 file changed, 38 deletions(-) diff --git a/src/mongo/db/s/collection_sharding_runtime_test.cpp b/src/mongo/db/s/collection_sharding_runtime_test.cpp index 7e6be38d544..716527cf6d9 100644 --- a/src/mongo/db/s/collection_sharding_runtime_test.cpp +++ b/src/mongo/db/s/collection_sharding_runtime_test.cpp @@ -556,44 +556,6 @@ TEST_F(CollectionShardingRuntimeWithRangeDeleterTest, ASSERT(cleanupComplete.isReady()); } -TEST_F(CollectionShardingRuntimeWithRangeDeleterTest, - WaitForCleanCorrectEvenAfterClearFollowedBySetFilteringMetadata) { - globalFailPointRegistry().find("suspendRangeDeletion")->setMode(FailPoint::alwaysOn); - ScopeGuard resetFailPoint( - [=] { globalFailPointRegistry().find("suspendRangeDeletion")->setMode(FailPoint::off); }); - - OperationContext* opCtx = operationContext(); - auto metadata = makeShardedMetadata(opCtx, uuid()); - csr()->setFilteringMetadata(opCtx, metadata); - const ChunkRange range = ChunkRange(BSON(kShardKey << MINKEY), BSON(kShardKey << MAXKEY)); - const auto task = createRangeDeletionTask(opCtx, kTestNss, uuid(), range, 0); - - // Schedule range deletion that will hang due to `suspendRangeDeletion` failpoint - auto cleanupComplete = registerAndCreatePersistentTask( - opCtx, task, SemiFuture::makeReady() /* waitForActiveQueries */); - - // Clear and set again filtering metadata - csr()->clearFilteringMetadata(opCtx); - csr()->setFilteringMetadata(opCtx, metadata); - - auto waitForCleanUp = [&](Date_t timeout) { - return CollectionShardingRuntime::waitForClean(opCtx, kTestNss, uuid(), range, timeout); - }; - - // Check that the hanging range deletion is still tracked even following a clear of the metadata - auto status = waitForCleanUp(Date_t::now() + Milliseconds(100)); - ASSERT_NOT_OK(status); - ASSERT(!cleanupComplete.isReady()); - - globalFailPointRegistry().find("suspendRangeDeletion")->setMode(FailPoint::off); - resetFailPoint.dismiss(); - - // Check that the range deletion is not tracked anymore after it succeeds - status = waitForCleanUp(Date_t::max()); - ASSERT_OK(status); - ASSERT(cleanupComplete.isReady()); -} - class CollectionShardingRuntimeWithCatalogTest : public CollectionShardingRuntimeWithRangeDeleterTest { public: -- cgit v1.2.1