diff options
author | Nicholas Zolnierz <nicholas.zolnierz@mongodb.com> | 2020-02-13 15:09:48 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-02-13 15:09:48 +0000 |
commit | e87edace22b258809b6f209a3cdc6c123149a16b (patch) | |
tree | 4a189176dce4ffc5c0a2718325e8b5c030e464a6 /src/mongo | |
parent | e289b78c61033674f6440d9ddc402b50903717ac (diff) | |
download | mongo-e87edace22b258809b6f209a3cdc6c123149a16b.tar.gz |
SERVER-46087 Propagate allowDiskUse to shards for sharded $unionWith
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/pipeline/sharded_agg_helpers.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/sharded_agg_helpers.cpp b/src/mongo/db/pipeline/sharded_agg_helpers.cpp index fabc49ceb4e..d6d3569e5a8 100644 --- a/src/mongo/db/pipeline/sharded_agg_helpers.cpp +++ b/src/mongo/db/pipeline/sharded_agg_helpers.cpp @@ -128,7 +128,7 @@ BSONObj genericTransformForShards(MutableDocument&& cmdForShards, cmdForShards[AggregationRequest::kRuntimeConstants] = Value(constants.get().toBSON()); } - cmdForShards[AggregationRequest::kFromMongosName] = Value(true); + cmdForShards[AggregationRequest::kFromMongosName] = Value(expCtx->inMongos); // If this is a request for an aggregation explain, then we must wrap the aggregate inside an // explain command. if (explainVerbosity) { @@ -955,6 +955,11 @@ std::unique_ptr<Pipeline, PipelineDeleter> targetShardsAndAddMergeCursors( }(); AggregationRequest aggRequest(expCtx->ns, rawStages); + + // The default value for 'allowDiskUse' in the AggregationRequest may not match what was set + // on the originating command, so copy it from the ExpressionContext. + aggRequest.setAllowDiskUse(expCtx->allowDiskUse); + LiteParsedPipeline liteParsedPipeline(aggRequest); auto hasChangeStream = liteParsedPipeline.hasChangeStream(); auto shardDispatchResults = dispatchShardPipeline( |