[SERVER-40994] renameCollection should always lock system.views collection after everything else 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-41643 Create/drop view should lock system.v... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2019-05-06, Storage NYC 2019-05-20
Participants:
Linked BF Score: 5

 Description   

renameCollection now locks source and target namespaces sequentially based on their resourceIds order. But we should make an exception for "db.system.views" collection because any operation that triggers a view catalog reload will lock "db.system.views" in IS mode in the end.
For example, if an operation locks A first and then "db.system.views", and a concurrent renameCollection locks "db.system.views" first and then A, there could be a deadlock.

Therefore, renameCollection should always lock system.views in the end.



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

Author:

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

Message: SERVER-40994 renameCollection should always lock system.views collection after everything else
Branch: master
https://github.com/mongodb/mongo/commit/26c491f502389cd90118111076e75676b160e580

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