-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
See comments which include the full slack thread for context. In this ticket, we should:
- Standardize the behavior of explain commands across mongod and mongos to always short-circuit and return EOF-due-to-nonexistent-namespace when the namespace does not exist, rather than erroring.
- Update our documentation and release notes to inform users of the change and provide guidance for ways to check if a DB or collection does not exist. This will address users relying on error responses to detect non-existent namespaces.
- Understand which recent-ish changes to sharding have made it so that we can know on a router whether or not a namespace exists. This was not always the case (we used to forward commands against unknown namespaces to the primary shard). What changed?
Finally, this change presents an opportunity to unify several pieces of code which produce EOF-due-to-nonexistent-namespace output across the code base. As part of this ticket, we should try to unify the "EOF.*ExplainResult” helpers across the cluster command files (and whatever similar explain helpers exist in the regular single-shard files). This will have the additional benefit of standardizing which explain version output we use for these EOF plans (whether the EOF plan is under “winningPlan.queryPlan" or if it’s directly under “winningPlan")
- is related to
-
SERVER-120561 $planCacheStats fails for non-existent collection
-
- Backlog
-
-
SERVER-120673 Write explain operations should not implicitly create a database on a sharded cluster
-
- In Code Review
-
-
SERVER-96408 Explaning distinct command on non-existent database succeeds
-
- Closed
-
-
SERVER-18047 Explain on non-existent database should return error
-
- Backlog
-