Commit 95811f01 authored by Andrei Elkin's avatar Andrei Elkin

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.
parent 93b3a484
......@@ -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))
......
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