summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/s/drop_collection_coordinator.cpp12
1 files 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<Client> lk(*newClient.get());
+ newClient->setSystemOperationKillableByStepdown(lk);
+ }
+ auto alternativeOpCtx = newClient->makeOperationContext();
+ AlternativeClientRegion acr{newClient};
try {
removePersistentRangeDeletionTasksByUUID(alternativeOpCtx.get(), *collectionUUID);