diff options
author | Silvia Surroca <silvia.surroca@mongodb.com> | 2022-09-27 12:03:18 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-27 12:36:22 +0000 |
commit | 1ab9c22972efa05aa1f54f25c853b00aaa33455f (patch) | |
tree | 7886e0718632c23b2f3993ec16e850b59c8c9477 | |
parent | 4ef16e59e45b6777a8a5b829881676a55e6d4000 (diff) | |
download | mongo-1ab9c22972efa05aa1f54f25c853b00aaa33455f.tar.gz |
SERVER-70003 Alternative client for deleting range deletion documents must be interruptible on stepdown
-rw-r--r-- | src/mongo/db/s/drop_collection_coordinator.cpp | 12 |
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); |