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

parallelCollectionScan returns no cursors from empty collection

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Query
    • ALL

      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 }
      

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            david.golden@mongodb.com David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: