Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-59926

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

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Query Execution

    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.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            ali.mir@mongodb.com Ali Mir
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: