Explore mitigations for FLE2 text batch inserts exceeding BSON limit after mongocrypt conversion

XMLWordPrintableJSON

    • Needed
    • Hide

      Summary of necessary driver changes

      •  

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      •  

      Context for other referenced/linked tickets

      •  
      Show
      Summary of necessary driver changes   Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed)   Context for other referenced/linked tickets  

      Description:

      Summary

      joel.odom@mongodb.com has reported that when performing FLE2 batch inserts where each document contain multiple substring/suffix/prefix-indexed encrypted fields, users are very likely to run into "BSON limit exceeded" errors if there are enough documents in the batch. We believe that this may be due to libmongocrypt expanding the size of each encrypted text field when converting them to InsertUpdatePayload.

      Motivation

      Who is the affected end user?

      All FLE2 users of substring/suffix/prefix-indexed types (introduced in server v8.2).

      How does this affect the end user?

      Developers will likely have a poor experience using the FLE2 substring/prefix/suffix feature, as they may run into unexpected BSON limit errors frequently when doing batch writes.

      How likely is it that this problem or use case will occur?

      Very likely if the user is trying to insert many documents where each document expands massively due to the amount of substring/suffix/prefix fields contained in it.

      If the problem does occur, what are the consequences and how severe are they?

      BSON limit errors that may be unexpected to users if they are not aware of how libmongocrypt transforms their fields for indexed encryption.

      Is this issue urgent?

      No. This can be done after the server 8.2 version.

      Is this ticket required by a downstream team?

      No

      Is this ticket only for tests?

      No

      Acceptance Criteria

              Assignee:
              Unassigned
              Reporter:
              Erwin Pe
              Kevin Albertson Kevin Albertson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: