mirror of
https://github.com/MariaDB/server.git
synced 2025-10-12 12:25:37 +03:00
124 lines
3.5 KiB
Plaintext
124 lines
3.5 KiB
Plaintext
#
|
|
# MW-336 Slave threads may leak if variable wsrep_slave_threads is set repeatedly
|
|
#
|
|
|
|
--source include/galera_cluster.inc
|
|
--source include/have_innodb.inc
|
|
|
|
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
|
INSERT INTO t1 values(0);
|
|
|
|
--connection node_1
|
|
|
|
SET GLOBAL wsrep_slave_threads = 10;
|
|
SET GLOBAL wsrep_slave_threads = 1;
|
|
|
|
--echo # Wait 10 slave threads to start 1
|
|
--let $wait_timeout=600
|
|
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
|
--source include/wait_condition.inc
|
|
|
|
--connection node_2
|
|
# Wait until inserts are replicated
|
|
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
|
|
--source include/wait_condition.inc
|
|
--echo # Generate 12 replication events
|
|
--disable_query_log
|
|
--disable_result_log
|
|
--let $count = 12
|
|
while ($count)
|
|
{
|
|
INSERT INTO t1 VALUES (1);
|
|
--dec $count
|
|
}
|
|
--enable_result_log
|
|
--enable_query_log
|
|
|
|
--connection node_1
|
|
# Wait until inserts are replicated
|
|
--let $wait_condition = SELECT COUNT(*) = 13 FROM t1;
|
|
--source include/wait_condition.inc
|
|
|
|
SELECT COUNT(*) FROM t1;
|
|
|
|
--echo # Wait 9 slave threads to exit 1
|
|
# Wait until appliers exit
|
|
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
|
--source include/wait_condition.inc
|
|
|
|
SET GLOBAL wsrep_slave_threads = 10;
|
|
|
|
--echo # Wait 10 slave threads to start 2
|
|
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
|
--source include/wait_condition.inc
|
|
|
|
SET GLOBAL wsrep_slave_threads = 20;
|
|
|
|
--echo # Wait 20 slave threads to start 3
|
|
--let $wait_condition = SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
|
--source include/wait_condition.inc
|
|
|
|
SET GLOBAL wsrep_slave_threads = 1;
|
|
|
|
--connection node_2
|
|
--echo # Generate 40 replication events
|
|
--disable_query_log
|
|
--disable_result_log
|
|
--let $count = 40
|
|
while ($count)
|
|
{
|
|
INSERT INTO t1 VALUES (1);
|
|
--dec $count
|
|
}
|
|
--enable_query_log
|
|
--enable_result_log
|
|
|
|
--connection node_1
|
|
|
|
# Wait until inserts are replicated
|
|
--let $wait_condition = SELECT COUNT(*) = 53 FROM t1;
|
|
--source include/wait_condition.inc
|
|
|
|
SELECT COUNT(*) FROM t1;
|
|
|
|
--echo # Wait 10 slave threads to exit 3
|
|
# Wait until appliers exit
|
|
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
|
--source include/wait_condition.inc
|
|
|
|
SET GLOBAL wsrep_slave_threads = 10;
|
|
SET GLOBAL wsrep_slave_threads = 0;
|
|
|
|
--echo # Wait 10 slave threads to start 3
|
|
--let $wait_timeout=600
|
|
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
|
--source include/wait_condition.inc
|
|
|
|
--connection node_2
|
|
--echo # Generate 12 replication events
|
|
--disable_query_log
|
|
--disable_result_log
|
|
--let $count = 12
|
|
while ($count)
|
|
{
|
|
INSERT INTO t1 VALUES (1);
|
|
--dec $count
|
|
}
|
|
--enable_result_log
|
|
--enable_query_log
|
|
|
|
--connection node_1
|
|
# Wait until inserts are replicated
|
|
--let $wait_condition = SELECT COUNT(*) = 65 FROM t1;
|
|
--source include/wait_condition.inc
|
|
|
|
SELECT COUNT(*) FROM t1;
|
|
|
|
--echo # Wait 10 slave threads to exit 4
|
|
# Wait until appliers exit
|
|
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
|
--source include/wait_condition.inc
|
|
|
|
--connection node_1
|
|
DROP TABLE t1;
|