[SERVER-40992] ViewCatalog should grab mutex after locking the collection Created: 03/May/19  Updated: 29/Oct/23  Resolved: 14/May/19

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

Type: Bug Priority: Major - P3
Reporter: Xiangyu Yao (Inactive) Assignee: Xiangyu Yao (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-51320 Investigate removing <dbname>.system.... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2019-05-06, Storage NYC 2019-05-20
Participants:
Linked BF Score: 9

 Description   

Currently, ViewCatalog holds its own mutex while reloading from durable view catalog. Reloading from durable view catalog takes a collection lock in IS mode on "db.system.views".

Holding a mutex while doing db/collection locking may cause deadlock (see linked BF). We should either switch the order or release the mutex before locking and introduce new mutex if necessary.



 Comments   
Comment by Githook User [ 14/May/19 ]

Author:

{'name': 'Xiangyu Yao', 'username': 'xy24', 'email': 'xiangyu.yao@mongodb.com'}

Message: SERVER-40992 Always lock system.views before view operations
Branch: master
https://github.com/mongodb/mongo/commit/7c61da8d028982efbadc06a6b8b7ec4bb7af83ad

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