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

find command implementation on mongos does not respect "singleBatch" option

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.9
    • None
    • Querying, Sharding
    • None
    • Fully Compatible
    • ALL
    • Quint 9 09/18/15
    • 0

    Description

      The implementation of the find command on mongos currently ignores the "singleBatch" option. Instead, the find command needs to delete the cursor associated with the user query if "singleBatch" is set.

      To reproduce:

      mongos> db.foo.insert({})
      WriteResult({ "nInserted" : 1 })
      mongos> db.foo.insert({})
      WriteResult({ "nInserted" : 1 })
      mongos> db.foo.insert({})
      WriteResult({ "nInserted" : 1 })
      mongos> db.foo.insert({})
      WriteResult({ "nInserted" : 1 })
      mongos> db.foo.runCommand({find:"foo", batchSize: 2, singleBatch: true})
      {
      	"cursor" : {
      		"id" : NumberLong("3770113749959775933"), // Unexpected: this value should be zero.
      		"ns" : "test.foo",
      		"firstBatch" : [
      			{
      				"_id" : ObjectId("55fb050f8be93f1540cba838")
      			},
      			{
      				"_id" : ObjectId("55fb050f8be93f1540cba839")
      			}
      		]
      	},
      	"ok" : 1
      }
      

      Attachments

        Activity

          People

            rassi J Rassi
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: