diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-12-08 11:26:49 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-12-08 11:26:49 +0300 |
commit | 226d3e4f1e18ddd3e065811a7ec1a0daaaf3c2e8 (patch) | |
tree | d03ec277a0308d4245ba970b0380e4cac091364d /sql/mysql_priv.h | |
parent | a26d3f9963b2c5becd615a87ba4a249405e0bbf1 (diff) | |
download | mariadb-git-226d3e4f1e18ddd3e065811a7ec1a0daaaf3c2e8.tar.gz |
Backport of:
------------------------------------------------------------
revno: 2617.65.6
committer: Dmitry Lenev <dlenev@mysql.com>
branch nick: mysql-azalea-bg39674
timestamp: Sat 2009-07-25 00:28:43 +0400
message:
Fix for bug #39674 "On shutdown mdl_destroy() called before
plugin_shutdown()".
Attempt to shutdown PBXT engine plugin led to assertion failure
caused by using already destroyed mutex in metadata locking
subsystem.
This problem stemmed from the fact that we MDL subsystem and
table definition cache were deinitialized before plugin shutdown
while PBXT plugin during its shutdown process accessed tables and
therefore expected them to be in working shape.
This patch solves this problem by moving deinitialization of
these two subsystems after plugins are shut down.
No test case is provided since such test case would require
using PBXT or other plugin which accesses tables during its
shutdown process.
sql/mysql_priv.h:
Introduced table_def_start_shutdown() function which informs
table definition cache that shutdown process has been started
so it has to keep number of TABLE and TABLE_SHARE objects minimal
in order to reduce number of references to pluggable engines.
sql/mysqld.cc:
Destroy table definition cache and meta-data locking subsystem
after shutting down plugins. This allows plugins to work with
tables during their shutdown.
Since table definition cache hold references to storage engine
plugins we have to remove unused tables from it before shutting
down plugins and keep number of these references minimal during
the process (by immediately removing tables opened during this
process from the table definition cache).
sql/sql_base.cc:
Introduced table_def_start_shutdown() function which informs
table definition cache that shutdown process has been started
so it has to keep number of TABLE and TABLE_SHARE objects
minimal in order to reduce number of references to pluggable
engines.
This allows to smoothly shutdown such plugins without completely
prohibiting access to tables/table definition cache while
shutting down other plugins.
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r-- | sql/mysql_priv.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 159613c58a0..74c5af92229 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1047,6 +1047,7 @@ bool compare_record(TABLE *table); bool append_file_to_dir(THD *thd, const char **filename_ptr, const char *table_name); bool table_def_init(void); +void table_def_start_shutdown(void); void table_def_free(void); void assign_new_table_id(TABLE_SHARE *share); uint cached_open_tables(void); |