[SERVER-59926] Appending bindata to a Document limits the size to BSONObjMaxUserSize - 1 Created: 13/Sep/21  Updated: 20/Jan/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Ali Mir Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

When working with documents, appending BinData to a doc limits the size of the binary data to be BSONObjMaxUserSize - 1, instead of BSONObjMaxUserSize.

This seems to be because when we append the data field, we use the function RCString::create, linked here. This function uasserts if the size of the data is greater than or equal to the BSONObjMaxUserSize, to account for the NULL. For binary data, we don't have to account for the NULL.

Not sure if this is worth fixing, but thought I'd bring it up because while working with binary data in documents for the agg portion of File-Copy Based Initial Sync I've had to manually decrement BSONObjMaxUserSize in a few places to prevent getting error like Tried to create string longer than 16MB.



 Comments   
Comment by David Storch [ 20/Jan/23 ]

We agreed during QE quick wins triage to remove this from the quick wins epic.

Generated at Thu Feb 08 05:48:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.