Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-69416

Mongos fails explain cmd when database doesn't exist

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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] 
      

       

      From:
      https://evergreen.mongodb.com/lobster/build/88ee203b553c2020128ed292340a9d9d/test/62f5268154f2484378a8aab0#bookmarks=0%2C114

            Assignee:
            backlog-server-cluster-scalability [DO NOT USE] Backlog - Cluster Scalability
            Reporter:
            adi.zaimi@mongodb.com Adi Zaimi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: