[SERVER-78021] Retrying setAllowMigrations command may end up in a deadlock Created: 13/Jun/23  Updated: 29/Oct/23  Resolved: 06/Jul/23

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

Type: Bug Priority: Major - P3
Reporter: Silvia Surroca Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
Related
related to SERVER-79026 Failing to cancel the JournalFlusher ... Closed
is related to SERVER-73539 stopMigrations/resumeMigrations don't... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding EMEA 2023-06-26, Sharding EMEA 2023-07-10
Participants:
Linked BF Score: 140

 Description   

Retrying the setAllowMigrations command with a session and a txnNum (retryableWrite:true) may end up with a deadlock, competing for a session checkout and the _kChunkOpLock acquisition, as it's shown below:

 

First cmd: session checkout > lock _kChunkOpLock > session check-in > transaction happenssession checkout > unlock _kChunkOpLock
Second cmd: session checkout > lock _kChunkOpLock > session check-in > transaction happens > session checkout > unlock _kChunkOpLock



 Comments   
Comment by Githook User [ 06/Jul/23 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-78021 Prevent deadlock caused by session checkout and _chunkOpLock locking ordering
Branch: master
https://github.com/mongodb/mongo/commit/5489c851ef1be132decab35f0545ecd977468b68

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