[JAVA-3887] Driver sets getMore command batchSize to min(batchSize, remainingLimit) Created: 12/Nov/20  Updated: 24/Oct/23

Status: Blocked
Project: Java Driver
Component/s: Query Operations
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

The driver sets batchSize for getMore commands to the minimum of the configured batch size and the number of documents that would cause the configured limit to be reached. There is no reason to do this, and it actually causes the driver to sometimes send an unnecessary killCursors command, as in some scenarios mongos servers do not close the cursor if the limit was only just reached. It's also an inconsistency with other drivers that can cause issues with specification test expectations.

We should fix this by just sending the batchSize configured by the application.

At the same time, we can also remove all the client-side checks for the limit being reached, as the server now takes responsibility for that (ever since the introduction of the find command).



 Comments   
Comment by Jeffrey Yemin [ 17/Nov/20 ]

Blocked on future DRIVERS ticket, as there are several spec tests that assume the current behavior:

  • A successful find event with a getmore and the server kills the cursor in command-monitoring/find.json
  • A successful find event with a getmore and the server kills the cursor in unified-test-format/poc-command-monitoring.json
Generated at Thu Feb 08 09:00:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.