• Marko Mäkelä's avatar
    MDEV-25371 Potential hang in wsrep_is_BF_lock_timeout() · 7c524d44
    Marko Mäkelä authored
    In commit e71e6133 (MDEV-24671),
    lock_sys.wait_mutex was moved above lock_sys.mutex
    (which was later replaced with lock_sys.latch) in the latching order.
    
    In commit 7cf4419f (MDEV-24789),
    a potential hang was introduced to Galera. The function lock_wait()
    would hold lock_sys.wait_mutex while invoking wsrep_is_BF_lock_timeout(),
    which in turn could acquire LockMutexGuard for some diagnostic printout.
    
    wsrep_is_BF_lock_timeout(): Do not invoke trx_print_latched() or
    LockMutexGuard.
    
    lock_sys_t::wr_lock(), lock_sys_t::rd_lock(): Assert that the current
    thread is not holding lock_sys.wait_mutex.
    Unfortunately, RW-locks are not covered by SAFE_MUTEX.
    
    Reviewed by: Jan Lindström
    7c524d44
lock0lock.h 37.1 KB