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

Support running $lookup locally on shard for config.cache.chunks.* namespaces

    • Fully Compatible
    • Sharding 2020-07-27, Sharding 2020-08-10, Sharding 2020-08-24

      The config.cache.chunks.* collections are created as part of a shard refreshing the metadata (routing table) for a sharded collection. A complete copy of the config.cache.chunks.* collections exist on each shard (they are so-called reference tables). It is therefore always valid for a shard to read from a config.cache.chunks.* namespace locally. (The existing $lookup behavior is to do the merging on the primary shard for the database.)

      The from parameter to the $lookup stage should be made to support the following syntax:

      {from: {db: <string>, coll: <string>}}
      

      It must be an error to use this new syntax with any namespace other than config.cache.chunks.*

      Additionally, the $lookup stage must not attempt to route the request for config.cache.chunks.* to any other shard, even when the internalQueryAllowShardedLookup server parameter is enabled. Consider generalizing the check for the local database in the attachCursorToPipeline() function to be NamespaceString::isNamespaceAlwaysUnsharded().

            Assignee:
            haley.connelly@mongodb.com Haley Connelly
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: