Appending bindata to a Document limits the size to BSONObjMaxUserSize - 1

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            [DO NOT USE] Backlog - Query Execution
            Reporter:
            Ali Mir
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: