diff options
Diffstat (limited to 'src/mongo/db/commands/distinct.cpp')
-rw-r--r-- | src/mongo/db/commands/distinct.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp index d520b86450c..507894ffb4a 100644 --- a/src/mongo/db/commands/distinct.cpp +++ b/src/mongo/db/commands/distinct.cpp @@ -54,7 +54,6 @@ #include "mongo/db/query/query_planner_common.h" #include "mongo/db/query/view_response_formatter.h" #include "mongo/db/s/collection_sharding_state.h" -#include "mongo/db/transaction_participant.h" #include "mongo/db/views/resolved_view.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" @@ -184,12 +183,11 @@ public: // Distinct doesn't filter orphan documents so it is not allowed to run on sharded // collections in multi-document transactions. - auto txnParticipant = TransactionParticipant::get(opCtx); uassert(ErrorCodes::OperationNotSupportedInTransaction, "Cannot run 'distinct' on a sharded collection in a multi-document transaction. " "Please see http://dochub.mongodb.org/core/transaction-distinct for a recommended " "alternative.", - !txnParticipant || !txnParticipant.inMultiDocumentTransaction() || + !opCtx->inMultiDocumentTransaction() || !CollectionShardingState::get(opCtx, nss)->getCurrentMetadata()->isSharded()); const ExtensionsCallbackReal extensionsCallback(opCtx, &nss); |