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

Deadlock during setFCV when there are prepared transactions that have not persisted commit/abort decision

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • v6.0, v5.3, v5.0, v4.4
    • Execution Team 2022-05-02, Execution Team 2022-05-16
    • 169

    Description

      Here are the steps to reproduce the deadlock:

      • Run a cross-shard transaction with two participant shards, shard0 and shard1 where shard0 is the coordinator shard. Pause the TransactionCoordinator thread right before the commit decision is written (i.e. after the transaction has entered the "prepared" state).
      • Run a setFCV command against shard0. Wait until the setFCV thread is blocked waiting to acquire the global S lock (i.e. waiting for prepared transactions that existed before the FCV change to commit or abort).
      • Unpause the TransactionCoordinator thread. The transaction cannot commit since the TransactionCoordinator is blocked waiting to acquire the IX lock for the config.transaction_coordinators collection to write the commit decision.
      • Both the setFCV thread and TransactionCoordinator thread now hang.

      Attachments

        Issue Links

          Activity

            People

              gregory.noma@mongodb.com Gregory Noma
              cheahuychou.mao@mongodb.com Cheahuychou Mao
              Votes:
              0 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: