mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
BUG#14485479: INSTALL AUDIT PLUGIN HANGS IF WE TRY TO
DISABLE AND ENABLED DURING DDL OPERATION
PROBLEM: Same thread trying to acquire the same mutex
second time leads to hang/server crash.
While [un]installing audit_log plugin
a thread acquires the LOCK_plugin mutex
and after successful initialization tries
to write in mysql.plugin table. It holds
this mutex for a long time. If some how
plugin table is corrupted then a write to
plugin table will throw an error, thread try
to log this error in the audit_log plugin,
doing so it tries to acquire the mutex
again and results is server hang/crash.
SOLUTION: Releasing the LOCK_plugin mutex before
writing in mysql.plugin table. We dont
need to hold this mutex as thread already
acquired a TL_WRITE lock on mysql.plugin
table.
This commit is contained in:
22
mysql-test/include/have_null_audit_plugin.inc
Normal file
22
mysql-test/include/have_null_audit_plugin.inc
Normal file
@@ -0,0 +1,22 @@
|
||||
disable_query_log;
|
||||
#
|
||||
# Check if server has support for loading plugins
|
||||
#
|
||||
if (`SELECT @@have_dynamic_loading != 'YES'`) {
|
||||
--skip Null audit plugin requires dynamic loading
|
||||
}
|
||||
|
||||
#
|
||||
# Check if the variable AUDIT_NULL is set
|
||||
#
|
||||
if (!$AUDIT_NULL) {
|
||||
--skip Audit_null plugin requires the environment variable \$AUDIT_NULL to be set (normally done by mtr)
|
||||
}
|
||||
|
||||
#
|
||||
# Check if --plugin-dir was setup for null_audit db
|
||||
#
|
||||
if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$AUDIT_NULL_OPT/'`) {
|
||||
--skip null audit plugin requires that --plugin-dir is set to the null audit plugin dir (either the .opt file does not contain \$AUDIT_NULL_OPT or another plugin is in use)
|
||||
}
|
||||
enable_query_log;
|
||||
@@ -40,3 +40,4 @@ ha_blackhole storage/blackhole BLACKHOLE_PLUGIN
|
||||
ha_federated storage/federated FEDERATED_PLUGIN
|
||||
mypluglib plugin/fulltext SIMPLE_PARSER
|
||||
libdaemon_example plugin/daemon_example DAEMONEXAMPLE
|
||||
adt_null plugin/audit_null AUDIT_NULL
|
||||
|
||||
Reference in New Issue
Block a user