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

FLE2 with upsert: true can have upsertedDocuments.size() == 1 and updateReply.getNModified() == 1 at the same time

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0, 7.2.0-rc2, 7.0.5
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Server Security
    • Fully Compatible
    • ALL
    • v7.2, v7.0
    • Security 2023-11-13, Security 2023-11-27
    • 0

      sean.zimmerman@mongodb.com found that the following 2 lines looked like a bug:

      https://github.com/10gen/mongo-enterprise-modules/blob/master/jstests/fle2/bulk_write_update.js#L162 and https://github.com/10gen/mongo-enterprise-modules/blob/master/jstests/fle2/bulk_write_update.js#L176

      I confirmed that this is not from BulkWrite but from processFLEUpdate.

      erwin.pe@mongodb.com pointed to the code here and double checked that on a normal upsert this case would be nModified = 0 and n = 1. So nModified should be set here only if lastErrorObject.updatedExisting == true.

            Assignee:
            erwin.pe@mongodb.com Erwin Pe
            Reporter:
            frederic.vitzikam@mongodb.com Frederic Vitzikam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: