mirror of
https://github.com/MariaDB/server.git
synced 2025-11-25 17:25:02 +03:00
Problem was that tests select INFORMATION_SCHEMA.PROCESSLIST processes from user system user and empty state. Thus, there is not clear state for slave threads. Changes: - Added new status variables that store current amount of applier threads (wsrep_applier_thread_count) and rollbacker threads (wsrep_rollbacker_thread_count). This will make clear how many slave threads of certain type there is. - Added THD state "wsrep applier idle" when applier slave thread is waiting for work. This makes finding slave/applier threads easier. - Added force-restart option for mtr to always restart servers between tests to avoid race on start of the test - Added wait_condition_with_debug to wait until the passed statement returns true, or the operation times out. If operation times out, the additional error statement will be executed Changes to be committed: new file: mysql-test/include/force_restart.inc new file: mysql-test/include/wait_condition_with_debug.inc modified: mysql-test/mysql-test-run.pl modified: mysql-test/suite/galera/disabled.def modified: mysql-test/suite/galera/r/MW-336.result modified: mysql-test/suite/galera/r/galera_kill_applier.result modified: mysql-test/suite/galera/r/galera_var_slave_threads.result new file: mysql-test/suite/galera/t/MW-336.cnf modified: mysql-test/suite/galera/t/MW-336.test modified: mysql-test/suite/galera/t/galera_kill_applier.test modified: mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test modified: mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test modified: mysql-test/suite/galera/t/galera_var_slave_threads.test modified: mysql-test/suite/wsrep/disabled.def modified: mysql-test/suite/wsrep/r/variables.result modified: mysql-test/suite/wsrep/t/variables.test modified: sql/mysqld.cc modified: sql/wsrep_mysqld.cc modified: sql/wsrep_mysqld.h modified: sql/wsrep_thd.cc modified: sql/wsrep_var.cc
47 lines
1.5 KiB
Plaintext
47 lines
1.5 KiB
Plaintext
#
|
|
# This test checks that applier threads are immune to KILL QUERY and KILL STATEMENT
|
|
#
|
|
|
|
--source include/galera_cluster.inc
|
|
--source include/have_innodb.inc
|
|
--source include/force_restart.inc
|
|
|
|
--connection node_2
|
|
SET GLOBAL wsrep_slave_threads=2;
|
|
|
|
--let $wait_condition = SELECT COUNT(*) >= 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle';
|
|
--let $wait_condition_on_error_output = SELECT COUNT(*), 2 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
|
|
--source include/wait_condition_with_debug.inc
|
|
|
|
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle' LIMIT 1`
|
|
|
|
--disable_query_log
|
|
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
|
|
--eval KILL $applier_thread
|
|
|
|
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
|
|
--eval KILL QUERY $applier_thread
|
|
|
|
--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1`
|
|
|
|
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
|
|
--eval KILL $aborter_thread
|
|
|
|
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
|
|
--eval KILL QUERY $aborter_thread
|
|
--enable_query_log
|
|
|
|
SET GLOBAL wsrep_slave_threads=1;
|
|
|
|
--connection node_1
|
|
create table t1(a int not null primary key) engine=innodb;
|
|
insert into t1 values (1);
|
|
insert into t1 values (2);
|
|
|
|
--connection node_2
|
|
set global wsrep_sync_wait=15;
|
|
select count(*) from t1;
|
|
|
|
--connection node_1
|
|
drop table t1;
|