• mariadb-DebarunBanerjee's avatar
    MDEV-33669 mariabackup --backup hangs · 52f6df99
    mariadb-DebarunBanerjee authored
    This is a server hang and not an issue with backup. While concurrent
    DDLs in server gets in hanged state, mariabackup waits for DDLs to
    finish trying to acquire MDL_BACKUP_BLOCK_DDL.
    
    The server hang is serious in nature and caused by thread pool state
    being incorrectly set to thread creation pending state while no creation
    is actually pending. Once a thread pool reaches such state no new thread
    gets created in the pool.
    
    While it could possibly affect all thread pools in server, the innodb
    thread pool is the victim in current bug where IO job gets blocked when
    the pool is stuck with much less number of threads than intended.
    Available workers are blocked in purge waiting for page lock to be
    released by IO write (SX lock) causing a complete deadlock.
    
    The issue is caused by the state variable m_thread_creation_pending
    introduced by MDEV-31095: 9e62ab7a. We check and set the variable
    early while attempting to create a new thread in pool but fail to reset
    it if we exit the flow for other reasons like maximum threads reached
    or get into thread creation throttling path.
    
    Fix: The simple fix is to make sure that the state is reset back in case
    we don't actually attempt to create the thread.
    52f6df99
tpool_generic.cc 24.1 KB