[SERVER-41838] Release RSTL if we choose not to commit a prepared transaction after reacquiring it Created: 20/Jun/19  Updated: 29/Oct/23  Resolved: 25/Jun/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.2.0-rc2, 4.3.1

Type: Bug Priority: Major - P3
Reporter: Judah Schvimer Assignee: Judah Schvimer
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.2
Sprint: Repl 2019-07-01
Participants:
Linked BF Score: 21

 Description   

This is a bug when commitTransaction is being retried. A previous commitPreparedTransaction reacquires the RSTL and then fails due to a uassert. When it fails, it doesn't release the RSTL due to two phase locking, rather stashing the RSTL. A prepared transaction cannot hold the RSTL while stashed or else a deadlock with stepdown is possible. We should release the RSTL if we do not commit the prepared transaction (we can't fail but we can choose not to commit).



 Comments   
Comment by Githook User [ 25/Jun/19 ]

Author:

{'name': 'Judah Schvimer', 'username': 'judahschvimer', 'email': 'judah@mongodb.com'}

Message: SERVER-41838 Release RSTL if we choose not to commit a prepared transaction after reacquiring it

(cherry picked from commit 23bd9dc2cae50a9c1ae47fed7805db5da4f9583e)
Branch: v4.2
https://github.com/mongodb/mongo/commit/b07a423f391af20615e8fa9f32231a69209b75d4

Comment by Githook User [ 25/Jun/19 ]

Author:

{'name': 'Judah Schvimer', 'email': 'judah@mongodb.com', 'username': 'judahschvimer'}

Message: SERVER-41838 Release RSTL if we choose not to commit a prepared transaction after reacquiring it
Branch: master
https://github.com/mongodb/mongo/commit/23bd9dc2cae50a9c1ae47fed7805db5da4f9583e

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