• sunny's avatar
    branches/zip: Two changes to fix the problem: · 01bb13a3
    sunny authored
    1. First scan the joining transaction's locks and check if no other
    transaction is waiting for a lock held by the joining transaction.
    If no other transaction is waiting then  no deadlock an occur and
    we avoid doing an exhaustive search.
    
    2. Change the direction of the lock traversal from backward to forward.
    Previously we traversed backward from the lock that has to wait, the function
    to that fetched the previous node was very inefficient resulting in O(n^2)
    access to the rec lock list.
    
    Fix Bug #49047 InnoDB deadlock detection is CPU intensive with many locks on a single row.
    
    rb://218
    01bb13a3
lock0lock.c 156 KB