[SERVER-36979] Aborting a transaction must abort WUOW before releasing locks. Created: 04/Sep/18  Updated: 29/Oct/23  Resolved: 03/Oct/18

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.0.4, 4.1.4

Type: Bug Priority: Major - P3
Reporter: Matthew Russotto Assignee: Matthew Russotto
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.0
Sprint: Repl 2018-10-08
Participants:
Linked BF Score: 62

 Description   

When we abort a transaction from the expired transactions reaper (or otherwise outside the transaction), we call code in ~TxnResources which calls _locker->endWriteUnitOfWork, then _recoveryUnit->abortWriteUnitOfWork. In the usual case of allowing a WUOW to go out of scope, we call recoveryUnit->abortUnitOfWork and then lockState->endWriteUnitOfWork. The second order is correct. Calling endWriteUnitOfWork releases locks, but some of the internal machinery of abortUnitOfWork may require resources protected by those locks. In particular, in BF-10436, aborting an insert() expected the WiredTigerRecordStore to be available, but a concurrent dropCollection caused it to be destroyed.

Note the incorrect same ordering is used in ~OplogSlotReserver.



 Comments   
Comment by Githook User [ 19/Oct/18 ]

Author:

{'name': 'Matthew Russotto', 'email': 'matthew.russotto@10gen.com', 'username': 'mtrussotto'}

Message: SERVER-36979 Aborting a transaction must abort WUOW before releasing locks.
Branch: v4.0
https://github.com/mongodb/mongo/commit/899680b82d19b93fbc36007c192e9b294138f58e

Comment by Githook User [ 03/Oct/18 ]

Author:

{'name': 'Matthew Russotto', 'email': 'matthew.russotto@10gen.com', 'username': 'mtrussotto'}

Message: SERVER-36979 Aborting a transaction must abort WUOW before releasing locks.
Branch: master
https://github.com/mongodb/mongo/commit/a106c80c19b9265a2364d3d6386aef25cf23c322

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