[SERVER-76552] Skip taking CSSLock when acquiring CSS on non-shardsvr nodes Created: 26/Apr/23  Updated: 29/Oct/23  Resolved: 28/Apr/23

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

Type: Task Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0
Sprint: Sharding EMEA 2023-05-01
Participants:
Linked BF Score: 100

 Description   

SERVER-69435 changed the CollectionShardingState acquisition to always take the CSSLock, rather than taking it later when accessing some of it's data (e.g. checking the shardVersion, getting the collection description). On non-shardsvrs, accessing the CSS data didn't even take the CSSLock.

After SERVER-69435, the CSSLock is taken at acquisition time, both for shard and non-shard servers. This caused performance regression on non-sharded deployments. Since for non-sharded deployments the CSSLock is not really necessary, we can skip it and improve performance.



 Comments   
Comment by Githook User [ 02/May/23 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-76552 Skip taking CSSLock when acquiring CSS on non-shardsvr nodes
Branch: v7.0
https://github.com/mongodb/mongo/commit/6dcc2e48765c4b560b052c8fa9e04ee32de12f96

Comment by Githook User [ 27/Apr/23 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-76552 Skip taking CSSLock when acquiring CSS on non-shardsvr nodes
Branch: master
https://github.com/mongodb/mongo/commit/e56fac94f9aba4c3277cd07100eff86a457e49e1

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