diff options
author | Sergey Vojtovich <svoj@sun.com> | 2010-08-20 13:58:28 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@sun.com> | 2010-08-20 13:58:28 +0400 |
commit | b51c8cab3e0afccd6b44fea70e59243b24844158 (patch) | |
tree | e850824b3144dbcdd2a6f5ae296157e5713a9d67 /sql/sql_audit.h | |
parent | e28d6ee66a8404dd0f8fe3aaabb9d72544e5d42e (diff) | |
download | mariadb-git-b51c8cab3e0afccd6b44fea70e59243b24844158.tar.gz |
BUG#54989 - With null_audit installed, server hangs on an
attempt to install a plugin twice
Server crashes when [UN]INSTALL PLUGIN fails (returns an
error) and general log is disabled and there are audit
plugins interested in MYSQL_AUDIT_GENERAL_CLASS.
When audit event is triggered, audit subsystem acquires interested
plugins by walking through plugin list. Evidently plugin list
iterator protects plugin list by acquiring LOCK_plugin, see
plugin_foreach_with_mask().
On the other hand [UN]INSTALL PLUGIN is acquiring LOCK_plugin
rather for a long time.
When audit event is triggered during [UN]INSTALL PLUGIN, plugin
list iterator acquires the same lock (within the same thread)
second time.
Repeatable only with general_log disabled, because general_log
triggers MYSQL_AUDIT_GENERAL_LOG event, which acquires audit
plugins before [UN]INSTALL PLUGIN acquired LOCK_plugin.
With this fix we pre-acquire audit plugins for events that
may potentially occur during [UN]INSTALL PLUGIN.
This hack should be removed when LOCK_plugin is fixed so it
protects only what it supposed to protect.
No test case for this fix - we do not have facility to test
audit plugins yet.
sql/sql_audit.cc:
Move "acquire audit plugin" logics to a separate
function.
sql/sql_audit.h:
Move "acquire audit plugin" logics to a separate
function.
sql/sql_plugin.cc:
Pre-acquire audit plugins for events that may potentially occur
during [UN]INSTALL PLUGIN.
Diffstat (limited to 'sql/sql_audit.h')
-rw-r--r-- | sql/sql_audit.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_audit.h b/sql/sql_audit.h index 5b6962b9ecb..953e41f1f06 100644 --- a/sql/sql_audit.h +++ b/sql/sql_audit.h @@ -29,6 +29,7 @@ extern void mysql_audit_finalize(); extern void mysql_audit_init_thd(THD *thd); extern void mysql_audit_free_thd(THD *thd); +extern void mysql_audit_acquire_plugins(THD *thd, uint event_class); extern void mysql_audit_notify(THD *thd, uint event_class, |