[SERVER-39016] Make sharded $lookup queries run on non-primary shards able to target the primary shard Created: 15/Jan/19  Updated: 27/Oct/23  Resolved: 12/Jul/21

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

Type: Improvement Priority: Major - P3
Reporter: Ian Boros Assignee: Katherine Wu (Inactive)
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-38728 Allow pipeline with $lookup into a sh... Closed
is depended on by SERVER-39179 Confirm that aggregate command commen... Closed
is depended on by SERVER-39270 Allow top-level $lookup stages to run... Closed
Related
related to SERVER-58445 Complete TODO listed in SERVER-39016 Closed
Sprint: Query Optimization 2021-07-26
Participants:

 Description   

After SERVER-38728, when a $lookup query is run on a mongod, and the collection is unsharded, we'll assume that we can get the correct results by doing a local read. However, if the mongod is not the primary shard, this will lead to us returning incorrect (empty) results. Instead, we should add logic to send the query to the primary shard.



 Comments   
Comment by Katherine Wu (Inactive) [ 12/Jul/21 ]

Closing this as "Gone Away", since we currently don't do a local read in the unsharded case, and always follow the shard-targeting path. SERVER-58376 will track the optimization for local reads when it is possible to ensure the shard we're on is the primary and the 'from' collection is unsharded.

Comment by Ian Boros [ 07/Feb/19 ]

Putting this back on the backlog since my patch build revealed some issues and we've stopped work on this project.

Comment by James Wahlin [ 24/Jan/19 ]

It is possible that we will want to do SERVER-39015 and SERVER-38758 prior to this ticket. We should clarify as well what additional work would be needed here (if any) once those are in place.

Generated at Thu Feb 08 04:50:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.