[SERVER-20335] Mongos should not forward a getMore command to the shards with a batchSize of 0 Created: 09/Sep/15  Updated: 05/Oct/16  Resolved: 10/Sep/15

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

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: YunHe Wang
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to RUBY-1147 Error when sending getMore command on... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

python buildscripts/resmoke.py --executor=sharding_jscore_passthrough jstests/core/find_getmore_bsonsize.js

Sprint: Quint 9 09/18/15
Participants:

 Description   

If the batchSize associated with the initial find command is zero, then the AsyncResultsMerger will send a batchSize of zero to the shards for subsequent getMore commands. Setting a batchSize of zero is illegal for the getMore command and the mongod will return a BadValue error: "Batch size for getMore must be positive, but received: 0".

Instead, the getMore commands forwarded to the shards should not have a batchSize. In order to fix, we should not set the value of ClusterClientCursorParams::batchSize to boost::none rather than zero here:

https://github.com/mongodb/mongo/blob/4a6ff97bd91c340eea7142d13153a495ab3964a3/src/mongo/s/query/cluster_find.cpp#L149



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

Author:

{u'name': u'Yunhe (John) Wang', u'email': u'yunhe.wang@mongodb.com'}

Message: SERVER-20335 Mongos now forwards batchSize of none instead of 0

Closes #1018

Signed-off-by: David Storch <david.storch@10gen.com>
Branch: master
https://github.com/mongodb/mongo/commit/b3ca1d640e463be14134a2691c066fac18c54fe9

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