From 1ab9c22972efa05aa1f54f25c853b00aaa33455f Mon Sep 17 00:00:00 2001 From: Silvia Surroca Date: Tue, 27 Sep 2022 12:03:18 +0000 Subject: SERVER-70003 Alternative client for deleting range deletion documents must be interruptible on stepdown --- src/mongo/db/s/drop_collection_coordinator.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mongo/db/s/drop_collection_coordinator.cpp b/src/mongo/db/s/drop_collection_coordinator.cpp index 88accf1a8cd..7061a240378 100644 --- a/src/mongo/db/s/drop_collection_coordinator.cpp +++ b/src/mongo/db/s/drop_collection_coordinator.cpp @@ -76,10 +76,14 @@ DropReply DropCollectionCoordinator::dropCollectionLocally(OperationContext* opC if (collectionUUID) { // The multi-document remove command cannot be run in transactions, so run it using // an alternative client. - auto client = opCtx->getServiceContext()->makeClient("removeRangeDeletions-" + - collectionUUID->toString()); - auto alternativeOpCtx = client->makeOperationContext(); - AlternativeClientRegion acr{client}; + auto newClient = opCtx->getServiceContext()->makeClient("removeRangeDeletions-" + + collectionUUID->toString()); + { + stdx::lock_guard lk(*newClient.get()); + newClient->setSystemOperationKillableByStepdown(lk); + } + auto alternativeOpCtx = newClient->makeOperationContext(); + AlternativeClientRegion acr{newClient}; try { removePersistentRangeDeletionTasksByUUID(alternativeOpCtx.get(), *collectionUUID); -- cgit v1.2.1