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

parallelCollectionScan not honoring numCursors

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.5.5
    • Querying
    • None
    • ALL
    • Hide

      use t
      for(var i = 0; i < 10000; i++) db.t.insert({a:i})
      db.runCommand({parallelCollectionScan: 't', numCursors:6})

      Results in

      {
      	"cursors" : [
      		{
      			"cursor" : {
      				"firstBatch" : [ ],
      				"ns" : "t.t",
      				"id" : NumberLong("100109016162")
      			},
      			"ok" : true
      		},
      		{
      			"cursor" : {
      				"firstBatch" : [ ],
      				"ns" : "t.t",
      				"id" : NumberLong("100764228900")
      			},
      			"ok" : true
      		},
      		{
      			"cursor" : {
      				"firstBatch" : [ ],
      				"ns" : "t.t",
      				"id" : NumberLong("98906230722")
      			},
      			"ok" : true
      		},
      		{
      			"cursor" : {
      				"firstBatch" : [ ],
      				"ns" : "t.t",
      				"id" : NumberLong("100039922834")
      			},
      			"ok" : true
      		}
      	],
      	"ok" : 1
      }

      Show
      use t for(var i = 0; i < 10000; i++) db.t.insert({a:i}) db.runCommand({parallelCollectionScan: 't', numCursors:6}) Results in { "cursors" : [ { "cursor" : { "firstBatch" : [ ], "ns" : "t.t", "id" : NumberLong("100109016162") }, "ok" : true }, { "cursor" : { "firstBatch" : [ ], "ns" : "t.t", "id" : NumberLong("100764228900") }, "ok" : true }, { "cursor" : { "firstBatch" : [ ], "ns" : "t.t", "id" : NumberLong("98906230722") }, "ok" : true }, { "cursor" : { "firstBatch" : [ ], "ns" : "t.t", "id" : NumberLong("100039922834") }, "ok" : true } ], "ok" : 1 }

    Description

      Might be a documentation issue or bug but not sure. it does seem numCursors is the "upper" bound of cursors used instead of the fixed number of cursors returned.

      Attachments

        Activity

          People

            Unassigned Unassigned
            christkv Christian Amor Kvalheim
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: