summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/get_executor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/get_executor.cpp')
-rw-r--r--src/mongo/db/query/get_executor.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp
index 69500ef939e..12f62aea456 100644
--- a/src/mongo/db/query/get_executor.cpp
+++ b/src/mongo/db/query/get_executor.cpp
@@ -77,9 +77,8 @@
#include "mongo/db/query/stage_builder.h"
#include "mongo/db/repl/optime.h"
#include "mongo/db/repl/replication_coordinator.h"
-#include "mongo/db/s/collection_metadata.h"
#include "mongo/db/s/collection_sharding_state.h"
-#include "mongo/db/s/sharding_state.h"
+#include "mongo/db/s/operation_sharding_state.h"
#include "mongo/db/server_options.h"
#include "mongo/db/server_parameters.h"
#include "mongo/db/service_context.h"
@@ -705,7 +704,6 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getOplogStartHack(
StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> _getExecutorFind(
OperationContext* opCtx,
Collection* collection,
- const NamespaceString& nss,
unique_ptr<CanonicalQuery> canonicalQuery,
PlanExecutor::YieldPolicy yieldPolicy,
size_t plannerOptions) {
@@ -713,7 +711,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> _getExecutorFind(
return getOplogStartHack(opCtx, collection, std::move(canonicalQuery), plannerOptions);
}
- if (ShardingState::get(opCtx)->needCollectionMetadata(opCtx, nss.ns())) {
+ if (OperationShardingState::isOperationVersioned(opCtx)) {
plannerOptions |= QueryPlannerParams::INCLUDE_SHARD_FILTER;
}
return getExecutor(opCtx, collection, std::move(canonicalQuery), yieldPolicy, plannerOptions);
@@ -724,25 +722,22 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> _getExecutorFind(
StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorFind(
OperationContext* opCtx,
Collection* collection,
- const NamespaceString& nss,
unique_ptr<CanonicalQuery> canonicalQuery,
size_t plannerOptions) {
- auto readConcernArgs = repl::ReadConcernArgs::get(opCtx);
+ const auto& readConcernArgs = repl::ReadConcernArgs::get(opCtx);
auto yieldPolicy = readConcernArgs.getLevel() == repl::ReadConcernLevel::kSnapshotReadConcern
? PlanExecutor::INTERRUPT_ONLY
: PlanExecutor::YIELD_AUTO;
return _getExecutorFind(
- opCtx, collection, nss, std::move(canonicalQuery), yieldPolicy, plannerOptions);
+ opCtx, collection, std::move(canonicalQuery), yieldPolicy, plannerOptions);
}
StatusWith<std::unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorLegacyFind(
OperationContext* opCtx,
Collection* collection,
- const NamespaceString& nss,
std::unique_ptr<CanonicalQuery> canonicalQuery) {
return _getExecutorFind(opCtx,
collection,
- nss,
std::move(canonicalQuery),
PlanExecutor::YIELD_AUTO,
QueryPlannerParams::DEFAULT);
@@ -1321,7 +1316,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorCount(
}
size_t plannerOptions = QueryPlannerParams::IS_COUNT;
- if (ShardingState::get(opCtx)->needCollectionMetadata(opCtx, request.getNs().ns())) {
+ if (OperationShardingState::isOperationVersioned(opCtx)) {
plannerOptions |= QueryPlannerParams::INCLUDE_SHARD_FILTER;
}