-
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.
- is related to
-
SERVER-124445 Implement shard-side view resolution helper
-
- Closed
-
-
SERVER-42282 Consider replacing CommandOnShardedViewNotSupportedOnMongod mechanism with rewrite / routing from shard
-
- Closed
-