diff options
author | Tommaso Tocci <tommaso.tocci@mongodb.com> | 2021-01-30 05:37:54 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-01 19:13:15 +0000 |
commit | 9ed3c6bf2511e2754ae9f75ded7726e381bb1926 (patch) | |
tree | 8db5b9e379967cbd94ee829c8d74cd11093e8d53 /src/mongo/db/s/drop_collection_coordinator.cpp | |
parent | b01322a68ee65599610353bbafb0b7897a6ca7a8 (diff) | |
download | mongo-9ed3c6bf2511e2754ae9f75ded7726e381bb1926.tar.gz |
SERVER-54077 Introduce ForwardableOperationMetadata class for DDL operations
Diffstat (limited to 'src/mongo/db/s/drop_collection_coordinator.cpp')
-rw-r--r-- | src/mongo/db/s/drop_collection_coordinator.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/mongo/db/s/drop_collection_coordinator.cpp b/src/mongo/db/s/drop_collection_coordinator.cpp index 30fdff41216..c908a5020f8 100644 --- a/src/mongo/db/s/drop_collection_coordinator.cpp +++ b/src/mongo/db/s/drop_collection_coordinator.cpp @@ -32,7 +32,6 @@ #include "mongo/db/s/drop_collection_coordinator.h" #include "mongo/db/api_parameters.h" -#include "mongo/db/auth/authorization_session.h" #include "mongo/db/catalog_raii.h" #include "mongo/db/concurrency/lock_manager_defs.h" #include "mongo/db/s/database_sharding_state.h" @@ -53,13 +52,7 @@ namespace mongo { DropCollectionCoordinator::DropCollectionCoordinator(OperationContext* opCtx, const NamespaceString& nss) - : ShardingDDLCoordinator(nss), _serviceContext(opCtx->getServiceContext()) { - auto authSession = AuthorizationSession::get(opCtx->getClient()); - _users = - userNameIteratorToContainer<std::vector<UserName>>(authSession->getImpersonatedUserNames()); - _roles = - roleNameIteratorToContainer<std::vector<RoleName>>(authSession->getImpersonatedRoleNames()); -} + : ShardingDDLCoordinator(opCtx, nss), _serviceContext(opCtx->getServiceContext()) {} void DropCollectionCoordinator::_sendDropCollToParticipants(OperationContext* opCtx) { auto* const shardRegistry = Grid::get(opCtx)->shardRegistry(); @@ -101,9 +94,7 @@ SemiFuture<void> DropCollectionCoordinator::runImpl( ThreadClient tc{"DropCollectionCoordinator", _serviceContext}; auto opCtxHolder = tc->makeOperationContext(); auto* opCtx = opCtxHolder.get(); - - auto authSession = AuthorizationSession::get(opCtx->getClient()); - authSession->setImpersonatedUserData(_users, _roles); + _forwardableOpMetadata.setOn(opCtx); auto distLockManager = DistLockManager::get(_serviceContext); const auto dbDistLock = uassertStatusOK(distLockManager->lock( |