• Sergey Vojtovich's avatar
    MDEV-6749 - Deadlock between GRANT/REVOKE, SELECT FROM I_S.COLUMNS, · d1e46a50
    Sergey Vojtovich authored
                SET slow_query_log and failed connection attempt
    
    A very subtle though valid deadlock. Deadlock chain:
    wrlock(LOCK_grant)    -> lock(acl_cache->lock) GRANT/REVOKE CREATE/DROP USER
    lock(LOCK_open)       -> rdlock(LOCK_grant)    SELECT * FROM I_S.COLUMNS
    wrlock(LOCK_logger)   -> lock(LOCK_open)       SET @@global.slow_query_log='ON'
    lock(acl_cache->lock) -> rdlock(LOCK_logger)   Failed connection
    
    Fixed by removing relationship between acl_cache->lock and LOCK_logger
    during failed connection attempt.
    d1e46a50
sql_acl.cc 286 KB