-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Component/s: Command Logging and Monitoring, CRUD
-
Needed
-
When iterating a cursor on MongoDB < 3.2, drivers use OP_GET_MORE and are required to keep track of the limit manually. The client uses OP_GET_MORE's nToReturn field to limit the number of documents are returned in the final batch such that the overall total # documents equals the original "limit".
On MongoDB >=3.2, driver use the find and getMore commands and the server remembers what the original limit was. So when talking to MongoDB >=3.2, drivers do not need to manually track the limit and do not need to dynamically vary the getMore batchSize.
This ticket proposes that drivers remove the client side cursor limit tracking when talking to MongoDB >=3.2. If we implement this proposal we would at least need to update the "A successful find event with a getmore and the server kills the cursor" command monitoring test. The test would need to be split by server version because in the legacy case the getMore batchSize changes from 3 to 1 whereas in >=3.2 the getMore batchSize remains 3.
Motivation:
- The legacy client side limit tracking adds unneeded complexity for newer servers.
- Reducing the batchSize on the final getMore makes it more likely that drivers will need to run an unnecessary killCursors command (similar to DRIVERS-1447).
Note: Combining Limit and Batch Size for the Wire Protocol in the CRUD spec can also be removed as part of this ticket.
- is depended on by
-
JAVA-3887 Driver sets getMore command batchSize to min(batchSize, remainingLimit)
- Blocked
- is related to
-
DRIVERS-956 Command monitoring find tests are outdated
- Closed
- related to
-
CDRIVER-4001 Work around cursor issues on latest servers
- Closed
-
GODRIVER-1773 Reduce batchSize for getMore commands to match number of required documents
- Closed