Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20769

Remove global X lock from setShardVersion while initializing ShardingState

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.0-rc0
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Sharding A (10/09/15), Sharding B (10/30/15)

      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.

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: