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

Rework DocumentSourceInternalSearchIdLookUp to not rely on unversioned (sharding-unaware) reads

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration

      $search pipelines use `DocumentSourceInternalSearchIdLookUp` to retrieve the full documents given the _id s matched by mongot. DocumentSourceInternalSearchIdLookUp spins up a new query plan for each lookup. This query plan needs to survive shardVersion changes (e.g. due to a migration), so it cannot use a proper shard-versioned acquisition and instead operates in a sharding-unaware manner. $search works around this by manually injecting a shardFilter higher up the plan tree that will deal with filtering and also range preservation. While this may be correct, it does not conform to the ShardRole abstraction. We should change DocumentSourceInternalSearchIdLookUp to no longer execute unversioned plans.

      One idea is to make DocumentSourceInternalSearchIdLookUp not use a new plan for each idLookup, and instead reuse a plan that is constructed during planning and later can be repositioned for each idLookup. (An additional benefit of this could be better performance)

            Assignee:
            Unassigned Unassigned
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: