Commit d1e46a50 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-6749 - Deadlock between GRANT/REVOKE, SELECT FROM I_S.COLUMNS,

            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.
parent 53a44915
...@@ -9224,9 +9224,9 @@ bool acl_authenticate(THD *thd, uint connect_errors, ...@@ -9224,9 +9224,9 @@ bool acl_authenticate(THD *thd, uint connect_errors,
mpvio.auth_info.authenticated_as, TRUE); mpvio.auth_info.authenticated_as, TRUE);
if (!acl_proxy_user) if (!acl_proxy_user)
{ {
mysql_mutex_unlock(&acl_cache->lock);
if (!thd->is_error()) if (!thd->is_error())
login_failed_error(thd); login_failed_error(thd);
mysql_mutex_unlock(&acl_cache->lock);
DBUG_RETURN(1); DBUG_RETURN(1);
} }
acl_user= acl_proxy_user->copy(thd->mem_root); acl_user= acl_proxy_user->copy(thd->mem_root);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment