[SERVER-62563] Support sharding for collectionUUID parameter of aggregate command Created: 12/Jan/22  Updated: 29/Oct/23  Resolved: 14/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Task Priority: Major - P3
Reporter: Gregory Noma Assignee: Moustafa Maher
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by TOOLS-3067 Investigate changes in SERVER-62563: ... Closed
is depended on by TOOLS-3087 Investigate changes in SERVER-62563: ... Closed
Related
is related to SERVER-64872 Aggregate with collectionUUID on shar... Closed
Backwards Compatibility: Fully Compatible
Sprint: Replication 2022-02-07, Repl 2022-02-21
Participants:

 Description   

Currently the collectionUUID option for the aggregate command is disallowed on mongos.

 

Context change:

In the case of sharded collection, documents can be spanned to multiple shards, so the aggregation request can be directed to any subset of the shards, and if the targeted subset doesn't include the primaryShard of the database that may result in not finding the collection corresponding to the given collectionUUID.

To solve this problem we came up with two solutions:
1- Send dummy request to the primaryShard if the targeted shard subset doesn't include it and we didn't find the collection corresponding to the given collectionUUID.

2- Only allow collectionUUID parameter for commands that it must hit the primaryShard.

 

We have decided to go with the second solution for sharded aggregation command, so we are going to allow the collectionUUID parameter for only $indexStats and $collStats aggregation pipelines as replicator only needs these two pipelines. 
 



 Comments   
Comment by Githook User [ 07/Feb/22 ]

Author:

{'name': 'Moustafa Maher Khalil', 'email': 'm.maher@mongodb.com', 'username': 'moustafamaher'}

Message: SERVER-62563 Support sharding for collectionUUID parameter of aggregate command
Branch: master
https://github.com/mongodb/mongo/commit/0208541baad0a8223cf6d984754e916ee9ff20ec

Generated at Thu Feb 08 05:55:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.