[SERVER-40380] Test that inserting with a unique index and a prepared transaction causes prepare conflicts Created: 28/Mar/19  Updated: 29/Oct/23  Resolved: 03/Apr/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.1.10

Type: Task Priority: Major - P3
Reporter: Samyukta Lanka Assignee: Samyukta Lanka
Resolution: Fixed Votes: 0
Labels: prepare_testing
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Repl 2019-04-08
Participants:

 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.



 Comments   
Comment by Githook User [ 03/Apr/19 ]

Author:

{'name': 'Samy Lanka', 'username': 'lankas', 'email': 'samy.lanka@mongodb.com'}

Message: SERVER-40380 Test that inserting with a unique index and a prepared transaction causes prepare conflicts
Branch: master
https://github.com/mongodb/mongo/commit/03b632db90425af9902402a2527e67b6a75ca323

Generated at Thu Feb 08 04:54:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.