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

Behavior difference between count command with namespace or UUID

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc0
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Storage 2017-10-23
    • Linked BF Score:
      68

      Description

      count run on a non-existent namespace returns OK, but given a non-existent UUID it returns NamespaceNotFound

      > db.getCollectionInfos()
      [
              {
                      "name" : "foo",
                      "type" : "collection",
                      "options" : {
       
                      },
                      "info" : {
                              "readOnly" : false,
                              "uuid" : BinData(4,"tPsr7mDORhazM+lgLNtyIQ==")
                      },
                      "idIndex" : {
                              "v" : 2,
                              "key" : {
                                      "_id" : 1
                              },
                              "name" : "_id_",
                              "ns" : "test.foo"
                      }
              }
      ]
       
      > db.runCommand({count: BinData(4,"tPsr7mDORhazM+lgLNtyIQ==")})
      { "n" : 1, "ok" : 1 }
       
      > db.runCommand({count: BinData(4,"tPyu7mDORhazM+lgLNtyIe==")})
      {
              "ok" : 0,
              "errmsg" : "UUID b4fcaeee-60ce-4616-b333-e9602cdb7221 specified in count command not found in test database",
              "code" : 26,
              "codeName" : "NamespaceNotFound"
      }
       
      > db.runCommand({count: "jklklsdjk"})
      { "n" : 0, "ok" : 1 }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              geert.bosch Geert Bosch
              Reporter:
              spencer Spencer Brody (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: