Debian Codegraph @

mysql-test/suite/group_replication/t/gr_applier_thread_failure_detection.test

raw
1 # This test evaluates that group replication can detect SQL thread failures of
2 # its applier channel.
3 #
4 # The test guide is:
5 # 0. A two member group with started plugins
6 # 1. Create a table t1 on server 1 and replicate
7 # Also insert a value in the table without logging to the binlog
8 # 2. Insert a value on server 2 that will clash with data on server1
9 # 3. Check that server1 applier fails and the plugin goes to error mode.
10 # 4. Remove the value, restart the plugin and do a cleanup
11 #
12
13 --source include/big_test.inc
14 --source include/have_group_replication_plugin.inc
15 --source include/group_replication.inc
16
17 --echo #
18 --echo # 1. Create a table on server 1 and replicate
19 --echo # Also add a value in the table without logging to the binlog
20 --echo #
21
22 --let $rpl_connection_name= server1
23 --source include/rpl_connection.inc
24
25 CREATE TABLE t1 (a INT PRIMARY KEY);
26
27 SET SESSION sql_log_bin= 0;
28 INSERT INTO t1 VALUES (1);
29 SET SESSION sql_log_bin= 1;
30
31 --source include/rpl_sync.inc
32
33 --echo #
34 --echo # 2. Insert a value on server 2 that will clash with data on server1
35 --echo #
36
37 --let $rpl_connection_name= server2
38 --source include/rpl_connection.inc
39
40 INSERT INTO t1 VALUES (1); # Duplicate entry
41
42 --echo #
43 --echo # 3. Check that server1 applier fails and the plugin goes to error mode.
44 --echo #
45
46 --let $rpl_connection_name= server1
47 --source include/rpl_connection.inc
48
49 --echo # Expect ERROR state.
50 --let $group_replication_member_state= ERROR
51 --source include/gr_wait_for_member_state.inc
52
53 --let $group_replication_number_of_members= 1
54 --source include/gr_wait_for_number_of_members.inc
55
56 --let $rpl_connection_name= server2
57 --source include/rpl_connection.inc
58
59 --echo # Wait for one member on server 2
60 --let $group_replication_number_of_members= 1
61 --source include/gr_wait_for_number_of_members.inc
62
63 --echo #
64 --echo # 4. Remove the value, restart the plugin and do a cleanup
65 --echo #
66
67 --let $rpl_connection_name= server1
68 --source include/rpl_connection.inc
69
70 --source include/stop_group_replication.inc
71
72 SET SESSION sql_log_bin= 0;
73 DELETE FROM t1 WHERE a=1;
74 SET SESSION sql_log_bin= 1;
75
76 --source include/start_group_replication.inc
77
78 DROP TABLE t1;
79
80 SET SESSION sql_log_bin= 0;
81 call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': Could not execute Write_rows event on table test.t1*.*");
82 call mtr.add_suppression("The applier thread execution was aborted. Unable to process more transactions, this member will now leave the group.");
83 call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
84 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
85 call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': Worker .* failed executing transaction .*");
86 call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': ... The replica coordinator and worker threads are stopped,.*");
87 SET SESSION sql_log_bin= 1;
88
89 --source include/group_replication_end.inc