-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 8.0.0, 7.0.31, 8.3.0-rc4
-
Component/s: None
-
None
-
Query Execution
-
ALL
-
-
200
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Summary
An aggregation referencing a cross-database involved namespace (e.g. config.collections via $lookup) tasserts with code 9453000 ("No resolved namespace provided for ...") whenever the source database contains a view whose collection name matches.
Discovered via jstestfuzz_concurrent (BF-43468).
Root cause
resolveInvolvedNamespaces() (in src/mongo/db/commands/query_cmd/aggregation_execution_state.cpp; originally in run_aggregate.cpp) handles cross-db namespaces by checking the source database for a same-named view (SERVER-51886). When one exists, resolveViewDefinition() inserts only the source-db view into the resolved namespace map; the cross-db involvedNs sits in an else branch that never runs. While the map was keyed by collection-name string this was masked by key collisions; SERVER-96197 changed the key to NamespaceString and the missing entry started tripping ExpressionContext::getResolvedNamespace.
Branch status
- master: not affected.
SERVER-109925("Add cross-db $unionWith", Atlas SQL) deleted the cross-DB special-case branch as a side effect. - v8.3: affected.
SERVER-122573revertedSERVER-109925on v8.3, reintroducing the buggy branch. - v8.0, v7.0: affected (never had the master cleanup).
Steps to reproduce: see the dedicated field on this ticket.
- is related to
-
SERVER-51886 $lookup + $merge pipeline may fail to resolve views correctly when collection names collide
-
- Closed
-
-
SERVER-96197 ExpressionContext's _resolvedNamespaces can't distinguish between collections with the same name in different dbs
-
- Closed
-
-
SERVER-123141 Ensure correctness of cross-db $unionWith/$lookup/$graphLookup
-
- Backlog
-
-
SERVER-122573 [v8.3] Revert cross-db $unionWith/$lookup support
-
- Closed
-
-
SERVER-125437 Scaffold resolveInvolvedNamespacesOnLiteParsed for recursive view handling
-
- Closed
-
-
SERVER-125450 Apply views to subpipelines recursively in mongod
-
- Closed
-
-
SERVER-109925 Add cross-db $unionWith to aggregation framework
-
- Closed
-