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

Step up deadlock between migration recovery and prepared transaction

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Sharding 2020-07-27
    • 35

      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.

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

              Created:
              Updated:
              Resolved: