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

parallelCollectionScan not honoring numCursors

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5.5
    • Component/s: Querying
    • Labels:
      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 }

      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.

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

              Created:
              Updated:
              Resolved: