Debian Codegraph @

mysql-test/suite/group_replication/r/gr_autorejoin_while_applier_locked.result

raw
1 include/group_replication.inc [rpl_server_count=3]
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection server1]
6
7 # 1. Create table t1 on server1 with binlog disabled and bootstrap the
8 # group
9 SET sql_log_bin=0;
10 CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT);
11 SET sql_log_bin=1;
12 include/start_and_bootstrap_group_replication.inc
13
14 # 2. Create table t1 on server2 with binlog disabled and join to the
15 # group
16 [connection server2]
17 SET sql_log_bin=0;
18 CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT);
19 SET sql_log_bin=1;
20 include/start_group_replication.inc
21
22 # 3. Server3 will do three attempts of rejoin to validate that not block
23 # and reduce stop_component timeout to recovery module stop faster
24 [connection server3]
25 SET @group_replication_autorejoin_tries_save = @@GLOBAL.group_replication_autorejoin_tries;
26 SET @group_replication_components_stop_timeout_save = @@GLOBAL.group_replication_components_stop_timeout;
27 SET GLOBAL group_replication_autorejoin_tries = 3;
28 SET GLOBAL group_replication_components_stop_timeout = 30;
29
30 # 4. Server3 disable binlog and suppress warnings, create table t1 and
31 # get pid. Pid will be used to expel member from group. Join group.
32 SET SESSION sql_log_bin= 0;
33 call mtr.add_suppression('On shutdown there was a timeout on the Group Replication applier termination.');
34 call mtr.add_suppression('Failed to stop the group replication applier thread.');
35 call mtr.add_suppression('Member was expelled from the group due to network failures, changing member status to ERROR.');
36 call mtr.add_suppression('The server was automatically set into read only mode after an error was detected.');
37 call mtr.add_suppression('The group_replication_applier channel is still running, most likely it is waiting for a database/table lock*');
38 call mtr.add_suppression('Unable to confirm whether the server has left the group or not.*');
39 CREATE TABLE pid_table(pid_no INT PRIMARY KEY);
40 LOAD DATA LOCAL INFILE 'pid_file' INTO TABLE pid_table;
41 DROP TABLE pid_table;
42 CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT);
43 SET SESSION sql_log_bin= 1;
44 [connection server3]
45 include/start_group_replication.inc
46
47 # 5. Enable super read only not to avoid problem set it after LOCK
48 # tables READ. Table locked will prevent server to finish recovery
49 [connection server_3]
50 SET GLOBAL super_read_only= 1;
51 FLUSH TABLES WITH READ LOCK;
52
53 # 6. Insert data on group
54 [connection server1]
55 INSERT INTO test.t1 VALUES (1, 1);
56 INSERT INTO test.t1 VALUES (2, 1);
57
58 # 7. Wait until group_replication_applier channel waits on table t1
59 # read lock
60 [connection server3]
61
62 # 8. Expel server3 from the group
63 [connection server1]
64 include/rpl_gr_wait_for_number_of_members.inc
65 [connection server2]
66 include/rpl_gr_wait_for_number_of_members.inc
67 [connection server3]
68
69 # 9. Server3 should change is status to ERROR
70 include/gr_wait_for_member_state.inc
71
72 # 10. Waiting for two auto-rejoin to happen, only the third attempt
73 # will be successful. First will fail due recovery fail to stop.
74 # Second fail to start applier module due channel being active
75 include/gr_wait_for_member_state.inc
76
77 # 11. Wait that message about applier being blocked was logged
78
79 # 12. UNLOCK tables on server3
80 [connection server_3]
81 UNLOCK TABLES;
82
83 # 13. Confirm that group_replication_applier channel is stopped
84
85 # 14. Wait for member to be ONLINE after autorejoin third attempt succeed
86 [connection server3]
87 include/gr_wait_for_member_state.inc
88
89 # 15. Cleanup
90 DROP TABLE t1;
91 SET GLOBAl group_replication_autorejoin_tries = @group_replication_autorejoin_tries_save;
92 SET GLOBAl group_replication_components_stop_timeout = @group_replication_components_stop_timeout_save;
93 include/group_replication_end.inc