[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: |
|
||||||||||||||||
| 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: Co-authored-by: Alya Carina Berciu alya.berciu@mongodb.com |
| Comment by Katherine Wu (Inactive) [ 23/Aug/21 ] |
|
Reopening to address this optimization as part of this project, as |