[SERVER-20769] Remove global X lock from setShardVersion while initializing ShardingState Created: 05/Oct/15  Updated: 25/Jan/17  Resolved: 09/Oct/15

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

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding A (10/09/15), Sharding B (10/30/15)
Participants:

 Description   

When setShardVersion is initializing the global sharding state it does so while holding an exclusive lock: https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/set_shard_version_command.cpp#L361

ShardingState initialization, however, can perform network traffic. Holding the exclusive lock while performing network traffic is a bad idea for several reasons, including that it can block stepdown and promotion to primary.

We should figure out why it's holding the global lock at all, and if there's no need we should remove it.



 Comments   
Comment by Githook User [ 09/Oct/15 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-20769 Remove global lock from setShardVersion
Branch: master
https://github.com/mongodb/mongo/commit/a16c8abbb18c6f12346ca8ab8b0316ff5e04034b

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