[SERVER-78662] Deadlock with index build, step down, prepared transaction, and MODE_IS coll lock Created: 05/Jul/23  Updated: 29/Jan/24  Resolved: 07/Aug/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.6

Type: Bug Priority: Major - P3
Reporter: Yujin Kang Park Assignee: Yujin Kang Park
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-79150 Reduce ScopedSetShardRole scope to se... Closed
Related
related to SERVER-75288 Investigate whether the stepdown kill... Open
related to SERVER-71198 Assert that unkillable operations tha... Backlog
is related to SERVER-44722 3 way deadlock can happen between hyb... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0, v6.0, v5.0
Sprint: Execution EMEA Team 2023-07-10, Execution EMEA Team 2023-07-24, Execution EMEA Team 2023-08-07, Execution EMEA Team 2023-08-21
Participants:
Linked BF Score: 105

 Description   
PreparedTransaction IndexBuild (uninterruptible by stepdown) OtherCommand StepDownThread
Hold coll MODE_IX lock      
  •  
Enqueue coll MODE_X lock (does not hold RSTL)    
  •  
  •  
AutoGetCollection(MODE_IS)  
  •  
  •  
  • Holds RSTL MODE_IX while waiting for collection lock
 
  •  
  •  
  •  
Enqueue RSTL MODE_X

Stepdown does not kill operations that do no take locks conflicting with writes.



 Comments   
Comment by Githook User [ 29/Jan/24 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-78662 Add timeout to MODE_X lock acquisition in index build

(cherry picked from commit 34d2cd582b02e49ace9f1c91033280035571d5cc)

GitOrigin-RevId: 0a3e0dd22b719026142d6ae1c418a7cb54807621
Branch: v7.0
https://github.com/mongodb/mongo/commit/fdb3c87f243279a0b7b6c83558a3849635750051

Comment by Githook User [ 07/Aug/23 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-78662 Add timeout to MODE_X lock acquisition in index build
Branch: minh.luu-no_compile_sys-perf
https://github.com/mongodb/mongo/commit/34d2cd582b02e49ace9f1c91033280035571d5cc

Comment by Githook User [ 04/Aug/23 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-78662 Add timeout to MODE_X lock acquisition in index build
Branch: master
https://github.com/mongodb/mongo/commit/34d2cd582b02e49ace9f1c91033280035571d5cc

Comment by Vishnu Kaushik [ 06/Jul/23 ]

Note that the original BF happened on 6.0, so we should backport this to that branch and maybe even further back if needed.

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