[SERVER-58376] Perform local read when $lookup into unsharded coll is on primary shard Created: 08/Jul/21  Updated: 29/Oct/23  Resolved: 30/Sep/21

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

Type: Improvement Priority: Major - P3
Reporter: Katherine Wu (Inactive) Assignee: Hana Pearlman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-58727 Perform local operation when AsyncReq... Closed
Problem/Incident
Related
Backwards Compatibility: Fully Compatible
Sprint: QO 2021-09-06, QO 2021-09-20, QO 2021-10-04
Participants:
Linked BF Score: 135

 Description   

Currently when run on a shard server, a $lookup will target shards to attach a cursor source regardless of whether the 'from' collection is sharded or unsharded. This is because, if the source collection is sharded and the 'from' collection is unsharded, the $lookup could be running on a non-primary shard and must target the primary (where the 'from' collection lives) to get correct results. However, if the $lookup is running on the primary shard of the database and the 'from' collection is unsharded, it is safe to perform local reads instead of targeting shards.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 30/Sep/21 ]

Author:

{'name': 'Hana Pearlman', 'email': 'hana.pearlman@mongodb.com', 'username': 'HanaPearlman'}

Message: SERVER-58376: Perform local reads when on the primary reading from an unsharded coll

Co-authored-by: Alya Carina Berciu alya.berciu@mongodb.com
Branch: master
https://github.com/mongodb/mongo/commit/6c4a4bb88aa29b8edb42690bf123a43d72a4c621

Comment by Katherine Wu (Inactive) [ 23/Aug/21 ]

Reopening to address this optimization as part of this project, as SERVER-58727 may not be possible to do from the sharding side (ex. difficulty for mirrored reads).

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