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

Deadlock on migration recipient stepdown

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 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

      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@mongodb.com Jordi Serra Torrens
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: