[SERVER-40723] Deadlock between S lock acquisition on secondary and prepare conflict Created: 18/Apr/19  Updated: 26/Jun/19  Resolved: 01/May/19

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

Type: Bug Priority: Major - P3
Reporter: Judah Schvimer Assignee: Judah Schvimer
Resolution: Duplicate Votes: 0
Labels: prepare_errors
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to SERVER-40936 add an invariant that we do not get ... Closed
split to SERVER-40937 remove the secondary DB lock acquisit... Closed
split to SERVER-40938 Add tests that dbhash and map-reduce ... Closed
Related
related to SERVER-41888 Shutting down with prepared transacti... Closed
is related to SERVER-39096 Prepared transactions and DDL operati... Closed
is related to SERVER-39372 Make secondary lock acquisition for D... Closed
is related to SERVER-40705 Stepdown with prepared transaction th... Closed
is related to SERVER-37199 Yield locks of transactions in second... Closed
is related to SERVER-38588 Hybrid index builds do not work when ... Closed
is related to SERVER-37988 recover locks on step up at the begin... Closed
Operating System: ALL
Sprint: Repl 2019-05-06
Participants:

 Description   

The following deadlock can occur:
1) A transaction goes in prepare in oplog application
2) A user operation acquires a lock in mode S and then blocks on a prepare conflict with the prepared transaction.
3) The commit of the prepared transaction attempts to reacquire (since the lock was yielded) an IX lock that conflicts with the mode S lock and blocks.

Possible solutions:
1) Do not yield locks for prepared transactions on secondaries.
2) Say such a user operation is illegal. We do not think they can occur today.
3) Yield locks in prepare conflicts



 Comments   
Comment by Judah Schvimer [ 01/May/19 ]

This ticket yielded SERVER-40936, SERVER-40937, and SERVER-40938. Closing since all of the work will be in those.

Comment by Judah Schvimer [ 23/Apr/19 ]

If we do not yield locks for prepared transactions, this will cause a deadlock on stepup dropping temp collections and be blocked on SERVER-39520.

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