Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-58376

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

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

      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@mongodb.com Hana Pearlman
            Reporter:
            katherine.wu@mongodb.com Katherine Wu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: