summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_skip.h
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2018-11-29 09:56:42 -0500
committerCharlie Swanson <charlie.swanson@mongodb.com>2019-02-13 07:30:10 -0500
commit87194fbe0c24525bc1f2d674012fe6978eca77d2 (patch)
tree0f13b14046152f0b475ae16d9a95b5e2ba0c4cbb /src/mongo/db/pipeline/document_source_skip.h
parent69f26fa3798b0d7927858aa704243cdac676c6e9 (diff)
downloadmongo-87194fbe0c24525bc1f2d674012fe6978eca77d2.tar.gz
SERVER-38311 Change out merging strategy
Allows an $out stage to run in parallel on all shards if the target collection is sharded and so is the input collection to the aggregate.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_skip.h')
-rw-r--r--src/mongo/db/pipeline/document_source_skip.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mongo/db/pipeline/document_source_skip.h b/src/mongo/db/pipeline/document_source_skip.h
index 883cde202bd..7a384d083ed 100644
--- a/src/mongo/db/pipeline/document_source_skip.h
+++ b/src/mongo/db/pipeline/document_source_skip.h
@@ -34,7 +34,7 @@
namespace mongo {
-class DocumentSourceSkip final : public DocumentSource, public NeedsMergerDocumentSource {
+class DocumentSourceSkip final : public DocumentSource {
public:
static constexpr StringData kStageName = "$skip"_sd;
@@ -84,11 +84,12 @@ public:
return DepsTracker::State::SEE_NEXT; // This doesn't affect needed fields
}
- boost::intrusive_ptr<DocumentSource> getShardSource() final {
- return nullptr;
- }
- MergingLogic mergingLogic() final {
- return {this};
+ /**
+ * The $skip stage must run on the merging half of the pipeline.
+ */
+ boost::optional<MergingLogic> mergingLogic() final {
+ // {shardsStage, mergingStage, sortPattern}
+ return MergingLogic{nullptr, this, boost::none};
}
long long getSkip() const {