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

Deadlock among createIndexes, index build commit, and step down

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0, 6.0.5
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • ALL
    • v6.0, v5.0
    • Execution Team 2023-02-06
    • 136

      In order to commit, an index build takes an X lock on its on its collection after explicitly unlocking the RSTL. Then a createIndexes command enqueues a collection IS lock (which implicitly takes the RSTL in IX) in order to check the TTL options on the command object. Now a step down occurs, enqueuing the RSTL in mode X. Now the index build attempts to take a collection IX lock on the config.system.indexBuilds collection, which first enqueues the RSTL in IX since it was previously unlocked. Thus a three-way deadlock has been reached. It seems the issue is that we should be waiting to re-acquire the RSTL until the subsequent timeout-retry logic.

            Assignee:
            gregory.noma@mongodb.com Gregory Noma
            Reporter:
            gregory.noma@mongodb.com Gregory Noma
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: