[CDRIVER-3310] OP_QUERY bulk write should not batch documents exceeding size of maxBsonObjectSize Created: 12/Aug/19  Updated: 31/Mar/22

Status: Backlog
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-3230 command options not included in bson ... Closed
is related to SERVER-10643 Document max document wire size in is... Closed

 Description   

As noted in the review of CDRIVER-3230, our logic for batching write operations for OP_QUERY seems a little off. We fit in as many documents as we can into maxBsonObjectSize + 16K allowance, but really, our logic should be:

1. Add bulk write documents to current batch until we reach maxBsonObjectSize
2. Add our command metadata (check that the metadata itself does not exceed 16K allowance)
3. Send, and start new batch


Generated at Wed Feb 07 21:17:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.