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

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.10
    • Component/s: Replication
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: