mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-5289: master server starts slave parallel threads
Delay spawning parallel replication worker threads until a slave SQL thread is running, and de-spawn them when the last SQL thread stops. This is especially useful to avoid needless threads on a master in a setup where same my.cnf is used on masters and slaves.
This commit is contained in:
@ -2,13 +2,20 @@
|
||||
|
||||
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
||||
|
||||
SELECT @@GLOBAL.slave_parallel_threads as 'must be zero because of default';
|
||||
# Check that we don't spawn worker threads at server startup, when no
|
||||
# slave is configured (MDEV-5289).
|
||||
SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
|
||||
|
||||
SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@SESSION.slave_parallel_threads as 'no session var';
|
||||
|
||||
SET GLOBAL slave_parallel_threads= 0;
|
||||
SET GLOBAL slave_parallel_threads= DEFAULT;
|
||||
SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default';
|
||||
SET GLOBAL slave_parallel_threads= 10;
|
||||
SELECT @@GLOBAL.slave_parallel_threads;
|
||||
# Check that we don't spawn worker threads when no slave is started.
|
||||
SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
|
||||
|
||||
SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads;
|
||||
|
Reference in New Issue
Block a user