Perform local read when $lookup into unsharded coll is on primary shard

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • QO 2021-09-06, QO 2021-09-20, QO 2021-10-04
    • 135
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Hana Pearlman
              Reporter:
              Katherine Wu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: