[SERVER-72346] Enforce the required lock mode in the DatabaseShardingState API Created: 21/Dec/22  Updated: 29/Oct/23  Resolved: 09/Feb/23

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

Type: Improvement Priority: Major - P3
Reporter: Daniel Gomez Ferro Assignee: Antonio Fuschetto
Resolution: Fixed Votes: 0
Labels: PM-2144-Milestone-0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2023-02-20
Participants:

 Description   

Similarly to SERVER-69770 , we should make the type of lock required to take the DatabaseShardingState be enforced by the API. One idea is to have two acquisition methods:

  • One that takes the exclusive lock and returns a non-const DSS.
  • The other takes the shared lock and returns a const DSS.
  • All methods that modify the DSS (i.e. need exclusive lock) should be made non-const. All methods that do not modify the DSS should be made const.


 Comments   
Comment by Githook User [ 09/Feb/23 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-72346 Enforce the required lock mode in the DatabaseShardingState API
Branch: master
https://github.com/mongodb/mongo/commit/f139c94b7ae8961f5b18df0e95e9708b3710929b

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