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

Step up deadlock between migration recovery and prepared transaction

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.7.0
    • None
    • Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 2020-07-27
    • 35

    Description

      As part of stepping up to primary, a node recovers migrations that were active on the previous primary. This involves synchronously scanning every document in config.migrationCoordinators and clearing the metadata for each corresponding namespace, which requires taking a collection X lock. This happens after the primary restores the locks of active prepared transactions (through MongoDSessionCatalog::onStepUp() called here), so if a prepared transaction has a lock on a namespace that had an active migration, taking the collection X lock on that namespace in migration recovery will block, preventing the step up from succeeding.

      Attachments

        Activity

          People

            tommaso.tocci@mongodb.com Tommaso Tocci
            jack.mulrow@mongodb.com Jack Mulrow
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: