• Sergey Vojtovich's avatar
    MDEV-5792 - Deadlock between SELECTs from METADATA_LOCK_INFO and another · b1232490
    Sergey Vojtovich authored
                I_S table
    
    mdl_iterate() helper function (which is used by the plugin to iterate mdl
    locks) acquired mutexes in reverse order.
    
    Fixed by iterating MDL locks in two stages:
    1. Iterate locks hash under the protection of hash mutex, store all
       lock pointers in a thread local array and increment reference counter
       for the lock.
    2. Iterate local array without protection of hash mutex, handle destroyed
       locks.
    
    It somewhat echoes hack in MDL_map_partition::move_from_hash_to_lock_mutex.
    b1232490
mdl.cc 94.9 KB