• Kristian Nielsen's avatar
    MDEV-7026: Race in InnoDB/XtraDB mutex implementation can stall or hang the server. · 6ea41f1e
    Kristian Nielsen authored
    The bug was that full memory barrier was missing in the code that ensures that
    a waiter on an InnoDB mutex will not go to sleep unless it is guaranteed to be
    woken up again by another thread currently holding the mutex. This made
    possible a race where a thread could get stuck waiting for a mutex that is in
    fact no longer locked. If that thread was also holding other critical locks,
    this could stall the entire server. There is an error monitor thread than can
    break the stall, it runs about once per second. But if the error monitor
    thread itself got stuck or was not running, then the entire server could hang
    infinitely.
    
    This was introduced on i386/amd64 platforms in 5.5.40 and 10.0.13 by an
    incorrect patch that tried to fix the similar problem for PowerPC.
    
    This commit reverts the incorrect PowerPC patch, and instead implements a fix
    for PowerPC that does not change i386/amd64 behaviour, making PowerPC work
    similarly to i386/amd64.
    6ea41f1e
os0sync.c 22.7 KB