[SERVER-76044] Support database-level aggregations for mongod in compute-mode Created: 13/Apr/23  Updated: 29/Oct/23  Resolved: 24/May/23

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

Type: Improvement Priority: Major - P3
Reporter: Divjot Arora (Inactive) Assignee: Yoon Soo Kim
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: QI 2023-05-01, QI 2023-05-15, QI 2023-05-29
Participants:

 Description   

If mongod is started with –setParameter enableComputeMode=true, it only supports collection-level aggregations that reference at least one external data source. It would be nice to support database-level aggregations (i.e. {aggregate: 1} commands) in this mode as well so that stages like $documents can be executed successfully.

Update by Yoonsoo:
Example repro:
In one window

$ build/install/bin/mongod --setParameter enableComputeMode=true

In test shell of another window

> db.aggregate([{$documents: [{a: 1}]}]);

Error message is thrown by this code
https://github.com/10gen/mongo/blob/master/src/mongo/db/commands/pipeline_command.cpp/#L128

We can do early return before the above check if the aggregate command is a collectionless one.



 Comments   
Comment by Githook User [ 24/May/23 ]

Author:

{'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}

Message: SERVER-76044 Support collectionless aggregates under the compute mode
Branch: master
https://github.com/mongodb/mongo/commit/c71265c685cd25540cdd6bb49a1e59a80b0c3f56

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