mirror of
https://github.com/MariaDB/server.git
synced 2025-05-05 16:59:35 +03:00
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.
22 lines
1.0 KiB
Plaintext
22 lines
1.0 KiB
Plaintext
--source include/not_embedded.inc
|
|
|
|
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
|
|
|
# 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;
|