[JAVA-2231] Legacy driver sends nToReturn of -1 for OP_GET_MORE for an aggregation with batch size of 1 Created: 17/Jun/16  Updated: 16/Feb/18  Resolved: 21/Jun/16

Status: Closed
Project: Java Driver
Component/s: Query Operations
Affects Version/s: 2.14.0
Fix Version/s: 2.14.3

Type: Bug Priority: Minor - P4
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-8125 Wire protocol documentation should no... Closed
related to SERVER-20808 Server should reject negative ntoretu... Closed

 Description   

The following code:

   collection.aggregate(pipeline, AggregationOptions.builder()
                                           .batchSize(1)
                                           .build())

will send nToReturn of -1 to OP_GET_MORE when fetching the second batch of documents.

On server 3.4, this results in a uassert:

AssertionException handling request, closing client connection: 34419 Invalid ntoreturn for OP_GET_MORE: -1

The driver should be fixed so that it sends nToReturn of 1 instead.



 Comments   
Comment by Githook User [ 16/Feb/18 ]

Author:

{'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin', 'username': 'jyemin'}

Message: JAVA-2231: Never send a negative nToReturn value for OP_GET_MORE, as the 3.4 server will reject it.
Branch: 2.14.x
https://github.com/mongodb/mongo-java-driver/commit/68939d1cd57034275bc81d6752264f1ffa63c66f

Comment by Jeffrey Yemin [ 18/Jul/16 ]

Released in 2.14.3

Comment by Githook User [ 21/Jun/16 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-2231: Never send a negative nToReturn value for OP_GET_MORE, as the 3.4 server will reject it.
Branch: 2.14.x
https://github.com/mongodb/mongo-java-driver/commit/68939d1cd57034275bc81d6752264f1ffa63c66f

Comment by Githook User [ 21/Jun/16 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-2231: Never send a negative nToReturn value for OP_GET_MORE, as the 3.4 server will reject it.
Branch: 2.x
https://github.com/mongodb/mongo-java-driver/commit/89329016d6ba7171de1be03dda6e17dabc23cd9c

Generated at Thu Feb 08 08:56:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.