diff options
author | Andrei Elkin <andrei.elkin@mariadb.com> | 2018-04-12 15:16:29 +0300 |
---|---|---|
committer | Andrei Elkin <andrei.elkin@mariadb.com> | 2018-04-13 17:39:18 +0300 |
commit | 95811f01f34705ea026e4b7bbebe2e00f7061f88 (patch) | |
tree | 09f5a89960a5e2fd2a88c25b94ddd9160c689321 | |
parent | 93b3a484364067a883dc838adbbcdef6ec12e07f (diff) | |
download | mariadb-git-95811f01f34705ea026e4b7bbebe2e00f7061f88.tar.gz |
MDEV-15796 MariaDB crashes on startup with semisync master enabled
Recent changes in semisync initialization via MDEV-13073 introduced
instantiation of THD too early from the server components
pov which led to segfault.
Fixed with relocating the semisync component initialization
to later time when thread specific memory can be used.
-rw-r--r-- | sql/mysqld.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9de6d090945..2db3bbe1bac 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5203,13 +5203,6 @@ static int init_server_components() "this server. However this will be ignored as the " "--log-bin option is not defined."); } - - if (repl_semisync_master.init_object() || - repl_semisync_slave.init_object()) - { - sql_print_error("Could not initialize semisync."); - unireg_abort(1); - } #endif if (opt_bin_log) @@ -5385,6 +5378,19 @@ static int init_server_components() } plugins_are_initialized= TRUE; /* Don't separate from init function */ +#ifdef HAVE_REPLICATION + /* + Semisync is not required by other components, which justifies its + initialization at this point when thread specific memory is also available. + */ + if (repl_semisync_master.init_object() || + repl_semisync_slave.init_object()) + { + sql_print_error("Could not initialize semisync."); + unireg_abort(1); + } +#endif + #ifndef EMBEDDED_LIBRARY { if (Session_tracker::server_boot_verify(system_charset_info)) |