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

Distributed lock should retry on duplicate key error creating the lock entry

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.7
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Sharding 7 08/10/15, Sharding 8 08/28/15
    • 0

      If two threads/processes both try to create a distributed lock on a new entity at the same time (for instance if they are both trying to create the same new database), then due to SERVER-14322, one of them might get a duplicate key error creating the entry in the config.locks collection. When we get that, currently we abandon trying to get the lock, even if we have more time left in our retry interval. We should be able to retry lock acquisition in this case, which is likely to succeed so long as the other process which was able to successfully create the config.locks entry releases the lock quickly.

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

              Created:
              Updated:
              Resolved: