summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_facet.cpp
diff options
context:
space:
mode:
authorBernard Gorman <bernard.gorman@gmail.com>2017-08-07 15:07:47 +0100
committerBernard Gorman <bernard.gorman@gmail.com>2017-08-08 19:04:30 +0100
commit9062f71621d053e32beec1061f708e3fd08b0158 (patch)
tree82fd151004fc4192126d71628e765e9257128feb /src/mongo/db/pipeline/document_source_facet.cpp
parent1dabf89e81b06b4d93a447e1fa5f6742b2f7afa1 (diff)
downloadmongo-9062f71621d053e32beec1061f708e3fd08b0158.tar.gz
SERVER-22760 Sharded aggregation pipelines which involve taking a simple union should merge on mongos
Diffstat (limited to 'src/mongo/db/pipeline/document_source_facet.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_facet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/document_source_facet.cpp b/src/mongo/db/pipeline/document_source_facet.cpp
index aba1f5f115c..e553ea2fa62 100644
--- a/src/mongo/db/pipeline/document_source_facet.cpp
+++ b/src/mongo/db/pipeline/document_source_facet.cpp
@@ -243,12 +243,12 @@ DocumentSource::StageConstraints DocumentSourceFacet::constraints() const {
for (auto&& facet : _facets) {
for (auto&& nestedStage : facet.pipeline->getSources()) {
- if (nestedStage->constraints().mustRunOnPrimaryShardIfSharded) {
+ if (nestedStage->constraints().hostRequirement == HostTypeRequirement::kPrimaryShard) {
// Currently we don't split $facet to have a merger part and a shards part (see
// SERVER-24154). This means that if any stage in any of the $facet pipelines
// requires the primary shard, then the entire $facet must happen on the merger, and
// the merger must be the primary shard.
- constraints.mustRunOnPrimaryShardIfSharded = true;
+ constraints.hostRequirement = HostTypeRequirement::kPrimaryShard;
}
}
}