[SERVER-20470] find command implementation on mongos does not respect "singleBatch" option Created: 17/Sep/15  Updated: 07/Oct/15  Resolved: 17/Sep/15

Status: Closed
Project: Core Server
Component/s: Querying, Sharding
Affects Version/s: None
Fix Version/s: 3.1.9

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Quint 9 09/18/15
Participants:
Linked BF Score: 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
}



 Comments   
Comment by Githook User [ 18/Sep/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-20470 tailable cursors should never be marked exhausted on mongos
Branch: master
https://github.com/mongodb/mongo/commit/8f7888830b8a548106c15cbab5cb153330585010

Comment by Githook User [ 17/Sep/15 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-20470 ClusterFind::runQuery() should respect LPQ::wantMore()
Branch: master
https://github.com/mongodb/mongo/commit/0b68c458923d4befe38e6f1294adb393f47bede1

Generated at Thu Feb 08 03:54:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.