Skip to content
  • Thirunarayanan Balathandayuthapani's avatar
    daa2d48d
    Bug #21983865 UNEXPECTED DEADLOCK WITH INNODB_AUTOINC_LOCK_MODE=0 · daa2d48d
    Thirunarayanan Balathandayuthapani authored
    
    
    Problem:
    =======
    This bug involves multiple thread waiting for AUTOINC_LOCK for the table
    and it leads to deadlock. Deadlock is happening because the count of
    the nodes visited exceeds the threshold limit(10^6).
    
    - Marking the subtree visited logic in the current deadlock search
    algorithm having some issue respect to table level lock.
    
    - While traversing the lock wait queue and if it reaches the current waiting
    lock then we mark the subtree as visited.
    
    - In row level lock, we are traversing from the head of the queue and eventually
    we will reach the current waiting lock in the lock wait queue.
    
    - But in table level lock, we are traversing from the tail of the queue,
    we will never reach the current waiting lock in the lock wait queue.
    
    Fix:
    ====
    
    To fix visiting subtree logic for table level lock,
    traverse from the head of the lock wait queue.
    
    Reviewed-by: default avatarDebarun <Banerjee&lt;debarun.banerjee@oracle.com>
    RB: 12147
    daa2d48d
    Bug #21983865 UNEXPECTED DEADLOCK WITH INNODB_AUTOINC_LOCK_MODE=0
    Thirunarayanan Balathandayuthapani authored
    
    
    Problem:
    =======
    This bug involves multiple thread waiting for AUTOINC_LOCK for the table
    and it leads to deadlock. Deadlock is happening because the count of
    the nodes visited exceeds the threshold limit(10^6).
    
    - Marking the subtree visited logic in the current deadlock search
    algorithm having some issue respect to table level lock.
    
    - While traversing the lock wait queue and if it reaches the current waiting
    lock then we mark the subtree as visited.
    
    - In row level lock, we are traversing from the head of the queue and eventually
    we will reach the current waiting lock in the lock wait queue.
    
    - But in table level lock, we are traversing from the tail of the queue,
    we will never reach the current waiting lock in the lock wait queue.
    
    Fix:
    ====
    
    To fix visiting subtree logic for table level lock,
    traverse from the head of the lock wait queue.
    
    Reviewed-by: default avatarDebarun <Banerjee&lt;debarun.banerjee@oracle.com>
    RB: 12147
Loading