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

Test that inserting with a unique index and a prepared transaction causes prepare conflicts

    • Fully Compatible
    • Repl 2019-04-08

      Test that the following scenario will hit prepare conflicts:

      1. Create a collection and add a unique index on the 'a' field
      2. Start a transaction
      3. Insert {_id: 1, a: 1}
      4. Update that unsets 'a' for {_id: 1}
      5. Prepare the transaction
      6. Outside of a transaction try to insert {_id: 2, a: 1}

      If this scenario did not encounter a prepare conflict, it would cause issues when recover prepared transactions at the end of initial sync. The initial insert in the transaction would fail with a duplicate key error and its update would also fail.

            Assignee:
            samy.lanka@mongodb.com Samyukta Lanka
            Reporter:
            samy.lanka@mongodb.com Samyukta Lanka
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: