[SERVER-47002] Investigate removing all remaining Database locks Created: 19/Mar/20  Updated: 10/Apr/20  Resolved: 10/Apr/20

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

Type: Question Priority: Major - P3
Reporter: Geert Bosch Assignee: Gregory Noma
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Execution Team 2020-03-23, Execution Team 2020-04-06, Execution Team 2020-04-20
Participants:

 Description   

As we no longer have any significant data structures in the catalog that need protection at the database level, almost all database locks (with a ResourceType of RESOURCE_DATABASE) are now IS and IX. This ticket is to find all remaining mode X and S locks and see if we can remove these.

If we can, we can flatten the hierarchy and completely get rid of these locks, gaining a little performance and simplifying the code base.



 Comments   
Comment by Gregory Noma [ 10/Apr/20 ]

As of writing this comment, the usages in the comment above without an associated closed server ticket are the remaining usages of database MODE_S and MODE_X locks outside of tests.

Comment by Gregory Noma [ 20/Mar/20 ]

Excluding tests, I believe this is the full list of locations where we still take a database lock in MODE_S or MODE_X. The vast majority of these are MODE_X, with only one or two MODE_S.

AutoGetDb:

AutoGetOrCreateDb:

Lock::DBLock:

Generated at Thu Feb 08 05:13:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.