Debian Codegraph @

mysql-test/suite/galera/t/galera_kill_applier.test

raw
1 #
2 # This test checks that applier threads are immune to KILL QUERY and KILL STATEMENT
3 #
4
5 --source include/galera_cluster.inc
6 --source include/have_innodb.inc
7 --source include/force_restart.inc
8
9 --connection node_2
10 SELECT @@wsrep_slave_threads;
11 SET GLOBAL wsrep_slave_threads=2;
12
13 --let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle';
14 --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
15 --source include/wait_condition_with_debug.inc
16
17 --let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle' LIMIT 1`
18
19 --replace_result $applier_thread ID
20 --error ER_KILL_DENIED_ERROR
21 --eval KILL $applier_thread
22
23 --replace_result $applier_thread ID
24 --error ER_KILL_DENIED_ERROR
25 --eval KILL QUERY $applier_thread
26
27 --let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1`
28
29 --replace_result $aborter_thread ID
30 --error ER_KILL_DENIED_ERROR
31 --eval KILL $aborter_thread
32
33 --replace_result $aborter_thread ID
34 --error ER_KILL_DENIED_ERROR
35 --eval KILL QUERY $aborter_thread
36
37 SET GLOBAL wsrep_slave_threads=DEFAULT;
38
39 --connection node_1
40 create table t1(a int not null primary key) engine=innodb;
41 insert into t1 values (1);
42 insert into t1 values (2);
43
44 --connection node_2
45 --echo # Wait until one of the appliers has exited
46 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
47 --let $wait_condition_on_error_output = SELECT COUNT(*), 1 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
48 --source include/wait_condition_with_debug.inc
49
50 select count(*) from t1;
51 SELECT @@wsrep_slave_threads;
52
53 --connection node_1
54 drop table t1;