Deadlock on migration recipient stepdown

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.0.0-rc9, 6.1.0-rc0
    • Affects Version/s: 6.0.0-rc6
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • v6.0
    • Sharding EMEA 2022-05-30, Sharding EMEA 2022-06-13
    • 144
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      On stepdown, while the replication coordinator is holding the RSTL lock in exclusive mode, MigrationDestinationManager::onStepDown() is called. This method takes the MigrationDestinationManager::_mutex.

      On the other side, MigrationDestinationManager::exitCriticalSection() first takes the same mutex, and later takes the lock hierarchy (here or here) which includes the RSTL lock.

      This inverted lock acquisition order can cause a deadlock on stepdown when a migration is interrupted if a particular interleaving occurs.

              Assignee:
              Jordi Serra Torrens
              Reporter:
              Jordi Serra Torrens
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: