[SERVER-21797] Simplify find batching logic Created: 08/Dec/15  Updated: 26/Nov/18  Resolved: 21/Jan/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.3.1

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

Issue Links:
Documented
is documented by DOCS-7018 batch size update Closed
Duplicate
is duplicated by SERVER-4727 MaxBytesToReturnToClientAtOnce seems ... Closed
Related
related to SERVER-19816 Oplog replication throughput is bound... Closed
related to SERVER-25551 Aggregation batchSize can't be set on... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query F (02/01/16)
Participants:

 Description   

The size of the result batch returned from a legacy OP_QUERY find or a find command is determined as follows:

  • If there is no batchSize set, add documents to the batch until the message size exceeds 1MB or we have 101 results.
  • If there is a batchSize set, add documents to the batch until the message size exceeds 4MB or we have enough documents to satisfy the user-provided batchSize.

We should consider make the following improvements:

  • Always size the batch at 16MB, rather than sometimes using 1MB and sometimes using 4MB.
  • Enforce a maximum message size of 16MB, rather than stopping once we have exceeded 16MB.


 Comments   
Comment by Githook User [ 21/Jan/16 ]

Author:

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

Message: SERVER-21797 unify cursor response commands to respond with up to 16MB of data

Find, getMore, aggregate, listIndexes, and listCollections now will
always return 16MB per batch, unless a batchSize limits the number of
response documents.
Branch: master
https://github.com/mongodb/mongo/commit/62172ae65d75c78e9e936784d0086c4b8133279b

Comment by Charlie Swanson [ 11/Dec/15 ]

After discussing, we should make sure this won't be annoying/backwards-breaking for drivers, and use 16MB as the limit.

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