[SERVER-45850] Remove mutex guards on read access for _shardId and _clusterId in ShardingState Created: 29/Jan/20  Updated: 29/Oct/23  Resolved: 05/Feb/20

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

Type: Improvement Priority: Major - P3
Reporter: Blake Oler Assignee: Blake Oler
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-02-10
Participants:
Linked BF Score: 0

 Description   

The ShardingState mutex guard for data read access on these variables is unnecessary, due to existing invariants that:

  1. Prevent the ShardingState from being initialized twice.
  2. Prevent the ShardingState's state variables (_shardId, _clusterId) from being accessed before initialization.

Removing these read access mutex acquisitions will reverse the performance drop found in BF-16012.



 Comments   
Comment by Githook User [ 05/Feb/20 ]

Author:

{'username': 'BlakeIsBlake', 'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com'}

Message: SERVER-45850 Remove mutex guards on read access for _shardId and _clusterId in ShardingState
Branch: master
https://github.com/mongodb/mongo/commit/3114642e2e211fadcbed1b41d13c9f9423a4e27f

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