Add a remote resolved namespaces cache to AggExState

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description: Adds pre-population infrastructure to AggExState so non-local namespaces can be resolved via the database primary before catalog locks are acquired, then consulted as a fallback during the locked local resolution pass.

      • prePopulateResolvedInvolvedNamespaces(): uses a racy CollectionCatalog snapshot as a heuristic to skip namespaces available locally, then calls resolveInvolvedNamespaceViaDatabasePrimary (SERVER-124445) for the rest. BFS through any nested view references.
      • _remoteResolvedNamespacesCache (boost::optional<ResolvedNamespaceMap>): holds the pre-resolved entries.
      • AggCatalogState::resolveInvolvedNamespaces: gains a cache-fallback branch that kicks in when the locked local catalog has no entry.
      • collatorCompatibleWithPipeline: extended to consult the cache for remote view definitions (branch restructure is semantically identical when the cache is empty).
      • invalidateRemoteResolvedNamespacesCache(): cache is invalidated when ResolvedViewAggExState replaces the lite-parsed pipeline.

      Rationale: SERVER-42282 resolves foreign namespaces via _shardsvrResolveView on the database primary — a network call that cannot be made under catalog locks. This ticket establishes the pre-lock cache so the main feature PR's diff focuses on the subrouter decision logic rather than the cache plumbing.

            Assignee:
            Finley Lau
            Reporter:
            Finley Lau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: