• Vlad Lesin's avatar
    MDEV-27701 Race on trx->lock.wait_lock between lock_rec_move() and lock_sys_t::cancel() · a474e327
    Vlad Lesin authored
    The initial issue was in assertion failure, which checked the equality
    of lock to cancel with trx->lock.wait_lock in lock_sys_t::cancel().
    
    If we analyze lock_sys_t::cancel() code from the perspective of
    trx->lock.wait_lock racing, we won't find the error there, except the
    cases when we need to reload it after the corresponding latches
    acquiring.
    
    So the fix is just to remove the assertion and reload
    trx->lock.wait_lock after acquiring necessary latches.
    
    Reviewed by: Marko Mäkelä <marko.makela@mariadb.com>
    a474e327
lock_move_wait_lock_race.result 1.31 KB