[SERVER-14689] parallelCollectionScan returns no cursors from empty collection Created: 25/Jul/14  Updated: 06/Dec/22  Resolved: 24/Aug/18

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: David Golden Assignee: Backlog - Query Team (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query
Operating System: ALL
Participants:

 Description   

The 2.7 nightly has a change (regression?) from 2.6 running parallelCollectionScan on an empty collection. In 2.6, it still returned a cursor. Somewhere in 2.7, it changed to returning no cursors at all. This may break drivers that expect at least one cursor to be returned.

Under 2.6:

> use test
switched to db test
> db.test_coll.insert({})
WriteResult({ "nInserted" : 1 })
> db.test_coll.remove({})
WriteResult({ "nRemoved" : 1 })
> db.test_coll.find({})
> db.runCommand({parallelCollectionScan:"test_coll", numCursors:3})
{
        "cursors" : [
                {
                        "cursor" : {
                                "firstBatch" : [ ],
                                "ns" : "test.test_coll",
                                "id" : NumberLong("64941895831323")
                        },
                        "ok" : true
                }
        ],
        "ok" : 1
}

Under 2.7 (4f01ffd9cbbb0dcb4ee2f9167ad2337178259ba9-2014-07-23):

> use test
switched to db test
> db.runCommand(
Display all 182 possibilities? (y or n)
> db.test_coll.insert({})
WriteResult({ "nInserted" : 1 })
> db.test_coll.remove({})
WriteResult({ "nRemoved" : 1 })
> db.test_coll.find({})
> db.runCommand({parallelCollectionScan:"test_coll", numCursors:3})
{ "cursors" : [ ], "ok" : 1 }



 Comments   
Comment by Asya Kamsky [ 24/Aug/18 ]

SERVER-33998 removed this option.

 

Comment by David Golden [ 25/Jul/14 ]

FWIW, the manual says "one or more":

parallelCollectionScan.cursors
An array with one or more cursors returned with the command.

Generated at Thu Feb 08 03:35:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.