MigrationManager signals the last migration for a namespace before freeing the collection dist lock

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 3.3.12
    • Affects Version/s: 3.3.12
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 2016-08-29
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When the MigrationManager schedules multiple concurrent migrations for the same namespace, the first migration to be scheduled will acquire the collection distributed lock and the last one to complete will release it.

      Currently when the last scheduled migration completes, it signals the migration as complete to the caller before releasing the distributed lock, which causes a race condition where an immediately scheduled 'moveChunk' command fails because the lock is not released yet.

      We should switch the order so that the last notification is signaled only after the distributed lock has been released.

            Assignee:
            Kaloian Manassiev
            Reporter:
            Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: