[SERVER-73935] Extend Pipeline::makePipeline to accept aggregate options Created: 13/Feb/23  Updated: 29/Oct/23  Resolved: 21/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Mihai Andrei Assignee: Adi Agrawal
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Sprint: QE 2023-02-20, QE 2023-03-06, QE 2023-03-20, QE 2023-04-03
Participants:

 Description   

The recommended way to construct a pipeline for internal use is 'Pipeline::makePipeline'. However, at the time of writing, this method doesn't support specifying any aggregate command options. This ticket tracks the work to support specifying aggregate options to Pipeline::makePipeline.

As an implementation note, this will likely involve plumbing aggregate options through 'attachCursorSourceToPipeline' so that they are available at the time of executor creation.



 Comments   
Comment by Githook User [ 21/Mar/23 ]

Author:

{'name': 'Adityavardhan Agrawal', 'email': 'adi.agrawal@mongodb.com', 'username': 'Adityav369'}

Message: SERVER-73935 Add Pipeline::makePipeline overload to accept AggregateCommandRequest
Branch: master
https://github.com/mongodb/mongo/commit/76d8c9d7d7328aac0f45a5405e448ece4c5d9aa3

Comment by Bernard Gorman [ 13/Feb/23 ]

Simplest way to do this would be a Pipeline::makePipeline overload which accepts an AggregateCommandRequest and forwards the request to sharded_agg_helpers::targetShardsAndAddMergeCursors, which contrary to its name can also route locally. Might be tricky to support all of the MakePipelineOpts this way, e.g. don't optimize the pipeline, don't attach a cursor source. However, those options are mostly for very specific internal Query requirements, so an overload that just takes an agg request and hands back a pipeline is probably ideal for most internal consumers.

Optionally, as part of this work we could update all callsites that currently call targetShardsAndAddMergeCursors directly or use other means of building pipelines to use the new Pipeline::makePipeline method.

Generated at Thu Feb 08 06:26:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.