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

Added document key in oplog entries can cause insert to fail due to size limit

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

      The maximum size of a BSON document that we allow for users to insert is 16 MB, and we allow for 16 KB of buffer space for internal BSON documents for a total internal limit of 16 MB + 16 KB.

      After SERVER-61891, the document _id is duplicated in the top-level oplog entry, and this may result in an issue when inserts are performed. For example, if a user were to insert a document with a fairly largeĀ _id of size 9MB, because the _id is duplicated in the oplog entry as the document key, the total size of the oplog entry becomes at least 18MB. This will cause the insert to fail, even though the user is trying to insert a document well under the 16MB limit. Even in cases where the document _id is not very large like 1MB, this issue can still occur if the rest of the doc is very close 15MB, so the document is slightly under 16MB, but the duplicatedĀ  _id in the oplog entry will send it over the limit and the insert will fail.

            Assignee:
            Unassigned Unassigned
            Reporter:
            joy.wang@mongodb.com Joy Wang
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: