-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Cluster Scalability
There is a difference in behavior between mongod and mongos when running explain command and db does not exist.
Mongod returns the explain plan, whereas mongos return a "database not found" error.
This can be seen in SERVER-68152 and https://jira.mongodb.org/browse/SERVER-68971 where explain_distinct.js fails when database doesn't exist:
[js_test:explain_distinct] assert: command failed: { [js_test:explain_distinct] "ok" : 0, [js_test:explain_distinct] "errmsg" : "database test not found", [js_test:explain_distinct] "code" : 26, [js_test:explain_distinct] "codeName" : "NamespaceNotFound", [js_test:explain_distinct] "$clusterTime" : { [js_test:explain_distinct] "clusterTime" : Timestamp(1660233344, 7), [js_test:explain_distinct] "signature" : { [js_test:explain_distinct] "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), [js_test:explain_distinct] "keyId" : NumberLong(0) [js_test:explain_distinct] } [js_test:explain_distinct] }, [js_test:explain_distinct] "operationTime" : Timestamp(1660233344, 7) [js_test:explain_distinct]
- related to
-
SERVER-18047 Explain on non-existent database should return error
- Backlog