-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sharding
-
None
-
Sharding EMEA 2022-10-17, Sharding EMEA 2022-10-31
SERVER-69434 changed DatabaseShardingState to protect concurrent access to it by using a LockManager RESOURCE_MUTEX with ResourceId(RESOURCE_MUTEX, dbName). However, constructing ResourceIds outside ResourceIdFactory is not correct and causes bugs like SERVER-70154. SERVER-69893 proposed a new LockManager lock type to work around this limitation, but agreement has been reached in favor of avoiding the introduction new lock types to the LockManager.
The proposed alternative is to use one single RESOURCE_MUTEX to protect access to all DatabaseShardingStates – for all databases in the system. The rationale is that:
- No blocking work is ever done under the this lock (only read in memory structures under IS, and update memory structures under X),
- X mode acquisitions are very rare.
- is depended on by
-
SERVER-70154 DatabaseShardingState inappropriately constructs a RESOURCE_MUTEX ResourceId, leading to uncaught exception
- Closed
- related to
-
SERVER-69434 Make the DSS acquisition a RAII
- Closed
-
SERVER-69893 Add the ability to acquire lock manager mutex resources by name
- Closed