[SERVER-79285] makeOperationContext should not be called on the primaryOnlyService instance cleanup executor Created: 25/Jul/23  Updated: 29/Oct/23  Resolved: 17/Aug/23

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

Type: Bug Priority: Major - P3
Reporter: Allison Easton Assignee: Silvia Surroca
Resolution: Fixed Votes: 0
Labels: shardingemea-qw
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-76463 Ensure Sharding DDL locks acquired ou... Closed
Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding EMEA 2023-08-21
Participants:
Linked BF Score: 10
Story Points: 2

 Description   

Full explanation in attached BF.

makeOperationContext calls registerOpCtx in the primary only service, which acquires the primary only service mutex.

If this is called while holding the sharding ddl coordinator service mutex, the operation holding it needs to be interrupted on stepdown to prevent a deadlock. In the case of constructInstance, it is being called on the instance cleanup executor (which is not interrupted on stepdown) while holding the sharding ddl coordinator service mutex. This can lead to deadlock on stepdown.



 Comments   
Comment by Githook User [ 17/Aug/23 ]

Author:

{'name': 'Silvia Surroca', 'email': 'silvia.surroca@mongodb.com', 'username': 'silviasuhu'}

Message: SERVER-79285 makeOperationContext should not be called on the primaryOnlyService instance cleanup executor
Branch: master
https://github.com/mongodb/mongo/commit/86f33523f9d1bc8f588c26cae17f078b45c7e031

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