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

Deadlock between index build setup, prepared transaction, and stepdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 6.1.1, 4.4.19, 5.0.15, 6.0.4, 6.2.0-rc0
    • None
    • None
    • Fully Compatible
    • ALL
    • v6.1, v6.0, v5.0, v4.4
    • Execution Team 2022-11-14, Execution Team 2022-11-28
    • 135

    Description

      When setting up an index build, we take a collection MODE_X lock. This can lead to a deadlock if there is also a replication state transition along with a prepared transaction. The index builder holds the RSTL in MODE_IX with the state transition waiting to take the RSTL in MODE_X. The index builder can't acquire the collection lock however because a prepared transaction is holding the collection lock in MODE_IX. In particular this is an issue because the index builder is purposely not interrupted for the state transition. See SERVER-44722 describing a similar issue. We should be able to fix this by unlocking the RSTL and retrying with a timeout like we do during index build commit.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: