[SERVER-49471] Retry on WT_ROLLBACK when applying prepareTransaction oplog entry Created: 13/Jul/20  Updated: 29/Oct/23  Resolved: 16/Jul/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.4.0-rc14, 4.2.9, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Suganthi Mani
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2
Sprint: Repl 2020-07-27
Participants:
Linked BF Score: 22

 Description   

When applying a prepareTransaction oplog entry, we apply all the operations here then fassert that this succeeds. However, applying the operations is allowed to fail with WT_ROLLBACK. We must add a writeConflictRetry loop that surrounds the storage transaction (which is started here).



 Comments   
Comment by Githook User [ 16/Jul/20 ]

Author:

{'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com', 'username': 'smani87'}

Message: SERVER-49471 Retry on WT_ROLLBACK (WriteConflictException) when applying prepareTransaction oplog entry.

(cherry picked from commit 525a83552575efba3274bebb2d4f94b8554c5e16)

SERVER-46049 Have _applyOperationsForTransaction() return a BadStatus instead of throwing

(cherry picked from commit 6840394ee0a015939ac7b0497d27fbfe8dda71e4)
Branch: v4.2
https://github.com/mongodb/mongo/commit/821acd4c97c24936a12af9d7b1a077714229ee3f

Comment by Githook User [ 16/Jul/20 ]

Author:

{'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com', 'username': 'smani87'}

Message: Revert "SERVER-49471 Retry on WT_ROLLBACK (WriteConflictException) when applying prepareTransaction oplog entry."

This reverts commit 7c23f84809b9d28dd54dbf8fc514568238bb0020.
Branch: v4.2
https://github.com/mongodb/mongo/commit/841fadf7603f11a4ea66217788c5cd763ca84a0e

Comment by Githook User [ 16/Jul/20 ]

Author:

{'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com', 'username': 'smani87'}

Message: SERVER-49471 Retry on WT_ROLLBACK (WriteConflictException) when applying prepareTransaction oplog entry.

(cherry picked from commit 525a83552575efba3274bebb2d4f94b8554c5e16)
Branch: v4.4
https://github.com/mongodb/mongo/commit/31b08e7d7e095132b7db3e8f4a4271478cf353ab

Comment by Githook User [ 16/Jul/20 ]

Author:

{'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com', 'username': 'smani87'}

Message: Revert "SERVER-49471 Retry on WT_ROLLBACK (WriteConflictException) when applying prepareTransaction oplog entry."

This reverts commit 4c82ec8cdf3c090d48c8802fb29adad6642c70fb.
Branch: v4.4
https://github.com/mongodb/mongo/commit/5c8f1ef2c41f056b2a83d930dd7e8f8180b41224

Comment by Githook User [ 16/Jul/20 ]

Author:

{'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com', 'username': 'smani87'}

Message: SERVER-49471 Retry on WT_ROLLBACK (WriteConflictException) when applying prepareTransaction oplog entry.

(cherry picked from commit 525a83552575efba3274bebb2d4f94b8554c5e16)

SERVER-46049 Have _applyOperationsForTransaction() return a BadStatus instead of throwing

(cherry picked from commit 6840394ee0a015939ac7b0497d27fbfe8dda71e4)
Branch: v4.2
https://github.com/mongodb/mongo/commit/7c23f84809b9d28dd54dbf8fc514568238bb0020

Comment by Githook User [ 16/Jul/20 ]

Author:

{'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com', 'username': 'smani87'}

Message: SERVER-49471 Retry on WT_ROLLBACK (WriteConflictException) when applying prepareTransaction oplog entry.

(cherry picked from commit 525a83552575efba3274bebb2d4f94b8554c5e16)
Branch: v4.4
https://github.com/mongodb/mongo/commit/4c82ec8cdf3c090d48c8802fb29adad6642c70fb

Comment by Githook User [ 15/Jul/20 ]

Author:

{'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com', 'username': 'smani87'}

Message: SERVER-49471 Retry on WT_ROLLBACK (WriteConflictException) when applying prepareTransaction oplog entry.
Branch: master
https://github.com/mongodb/mongo/commit/525a83552575efba3274bebb2d4f94b8554c5e16

Comment by Tess Avitabile (Inactive) [ 13/Jul/20 ]

Thanks for taking a look! We'll treat this as a blocker.

Comment by Kelsey Schubert [ 13/Jul/20 ]

tess.avitabile, I'm pretty concerned about it given how frequently we're seeing the BF crash. The fix from the description sounds straightforward (and safe), so I'd like to take it ASAP before GA. If these assumptions aren't correct, let me know.

I think otherwise, we'd want to put a know issue that multi-shard transactions may cause loss of write availability as secondaries would crash and need to be restarted.

Generated at Thu Feb 08 05:19:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.