summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_map_reduce_agg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/commands/cluster_map_reduce_agg.cpp')
-rw-r--r--src/mongo/s/commands/cluster_map_reduce_agg.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mongo/s/commands/cluster_map_reduce_agg.cpp b/src/mongo/s/commands/cluster_map_reduce_agg.cpp
index d478ef08d48..52a61ab9325 100644
--- a/src/mongo/s/commands/cluster_map_reduce_agg.cpp
+++ b/src/mongo/s/commands/cluster_map_reduce_agg.cpp
@@ -186,8 +186,9 @@ bool runAggregationMapReduce(OperationContext* opCtx,
pipelineBuilder,
cm,
involvedNamespaces,
- false, // hasChangeStream
- true); // allowedToPassthrough
+ false, // hasChangeStream
+ true, // allowedToPassthrough
+ false); // perShardCursor
try {
switch (targeter.policy) {
case cluster_aggregation_planner::AggregationTargeter::TargetingPolicy::kPassthrough: {
@@ -209,8 +210,7 @@ bool runAggregationMapReduce(OperationContext* opCtx,
case cluster_aggregation_planner::AggregationTargeter::TargetingPolicy::
kMongosRequired: {
// Pipelines generated from mapReduce should never be required to run on mongos.
- uasserted(31291, "Internal error during mapReduce translation");
- break;
+ MONGO_UNREACHABLE_TASSERT(31291);
}
case cluster_aggregation_planner::AggregationTargeter::TargetingPolicy::kAnyShard: {
@@ -233,6 +233,12 @@ bool runAggregationMapReduce(OperationContext* opCtx,
false)); // hasChangeStream
break;
}
+
+ case cluster_aggregation_planner::AggregationTargeter::TargetingPolicy::
+ kSpecificShardOnly: {
+ // It should not be possible to pass $_passthroughToShard to a map reduce command.
+ MONGO_UNREACHABLE_TASSERT(6273803);
+ }
}
} catch (DBException& e) {
uassert(ErrorCodes::CommandNotSupportedOnView,