parallelCollectionScan not honoring numCursors

XMLWordPrintableJSON

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

      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
              Reporter:
              Christian Amor Kvalheim
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: