• Monty's avatar
    MDEV-23586 Mariabackup: GTID saved for replication in 10.4.14 is wrong · 16ea692e
    Monty authored
    MDEV-21953 deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
    replication
    
    Fixed by partly reverting MDEV-21953 to put back MDL_BACKUP_COMMIT locking
    before log_and_order.
    
    The original problem for MDEV-21953 was that while a thread was waiting in
    for another threads to commit in 'log_and_order', it had the
    MDL_BACKUP_COMMIT lock. The backup thread was waiting to get the
    MDL_BACKUP_WAIT_COMMIT lock, which blocks all new MDL_BACKUP_COMMIT locks.
    This causes a deadlock as the waited-for thread can never get past the
    MDL_BACKUP_COMMIT lock in ha_commit_trans.
    
    The main part of the bug fix is to release the MDL_BACKUP_COMMIT lock while
    a thread is waiting for other 'previous' threads to commit. This ensures
    that no transactional thread keeps MDL_BACKUP_COMMIT while waiting, which
    ensures that there are no deadlocks anymore.
    16ea692e
handler.h 179 KB