Commit 004dd0aa authored by Kristian Nielsen's avatar Kristian Nielsen

MDEV-7568: STOP SLAVE crashes the server

The order of initialisation during server startup was incorrect. The slave
threads were started before the parallel replication worker thread pool was
initialised, allowing a race where uninitialised data could be accessed.
parent c1ebb4a6
......@@ -371,6 +371,9 @@ int init_slave()
if (run_slave_init_thread())
return 1;
if (global_rpl_thread_pool.init(opt_slave_parallel_threads))
return 1;
/*
This is called when mysqld starts. Before client connections are
accepted. However bootstrap may conflict with us if it does START SLAVE.
......@@ -404,9 +407,6 @@ int init_slave()
goto err;
}
if (global_rpl_thread_pool.init(opt_slave_parallel_threads))
return 1;
/*
If --slave-skip-errors=... was not used, the string value for the
system variable has not been set up yet. Do it now.
......
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