[SERVER-31339] Behavior difference between count command with namespace or UUID Created: 29/Sep/17  Updated: 30/Oct/23  Resolved: 06/Oct/17

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Geert Bosch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-33644 getMissingDoc in initial sync needs t... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage 2017-10-23
Participants:
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 }



 Comments   
Comment by Githook User [ 06/Oct/17 ]

Author:

{'email': 'geert@mongodb.com', 'name': 'Geert Bosch', 'username': 'GeertBosch'}

Message: SERVER-31339 Handle NamespaceNotFound in collection_cloner count/find
Branch: master
https://github.com/mongodb/mongo/commit/8043bcfcad60c1e705ff8305b5b0200de662e397

Generated at Thu Feb 08 04:26:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.