Debian Codegraph @

mysql-test/suite/group_replication/r/gr_autorejoin_while_recovery_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. Setup Server3.
23 # Set the attempts of rejoin to 3 so we validate the process wont
24 # block.
25 # Reduce stop_component timeout so recovery module stops faster.
26 [connection server3]
27 SET @group_replication_autorejoin_tries_save = @@GLOBAL.group_replication_autorejoin_tries;
28 SET @group_replication_components_stop_timeout_save = @@GLOBAL.group_replication_components_stop_timeout;
29 SET GLOBAL group_replication_autorejoin_tries = 3;
30 SET GLOBAL group_replication_components_stop_timeout = 30;
31
32 # 4. Server3 disable binlog and supreess warnings, create table t1 and
33 # get pid. Pid will be used to expel member from group
34 SET SESSION sql_log_bin= 0;
35 call mtr.add_suppression('On shutdown there was a timeout on the Group Replication recovery module termination. Check the log for more details');
36 call mtr.add_suppression('Member was expelled from the group due to network failures, changing member status to ERROR.');
37 call mtr.add_suppression('The server was automatically set into read only mode after an error was detected.');
38 call mtr.add_suppression("Error when stopping the group replication incremental recovery's donor connection");
39 call mtr.add_suppression('Unable to confirm whether the server has left the group or not. Check performance_schema.replication_group_members to check group membership information.');
40 CREATE TABLE pid_table(pid_no INT PRIMARY KEY);
41 LOAD DATA LOCAL INFILE 'pid_file' INTO TABLE pid_table;
42 DROP TABLE pid_table;
43 CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT);
44 SET SESSION sql_log_bin= 1;
45
46 # 5. Enable super read only, to avoid problem set it after FLUSH
47 # TABLES WITH READ LOCK. Table locked will prevent server from
48 # finishing 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. Join server3 to group, it will stay on recovery due transactions
59 # on group that it can't apply as the table is locked
60 [connection server3]
61 include/start_group_replication.inc
62
63 # 8. Wait until group_replication_recovery channel waits on table t1
64 # commit lock
65
66 # 9. Expel server3 from the group
67 [connection server1]
68 include/rpl_gr_wait_for_number_of_members.inc
69 [connection server2]
70 include/rpl_gr_wait_for_number_of_members.inc
71 [connection server3]
72
73 # 10. Server3 should change is status to ERROR
74 include/gr_wait_for_member_state.inc
75
76 # 11. Waiting for two auto-rejoin attempts to happen, they will fail
77 # due to recovery failing to stop
78
79 # 12. After the beginning of the second attempt server3 will stay in
80 # ERROR state
81 include/gr_wait_for_member_state.inc
82
83 # 13. group_replication_recovery channel still waits on table t1
84 # commit lock
85
86 # 14. UNLOCK tables on server3 and the join shall succeed
87 [connection server_3]
88 UNLOCK TABLES;
89
90 # 15. Server3 shall be ONLINE
91 [connection server3]
92 include/gr_wait_for_member_state.inc
93
94 # 16. Cleanup
95 DROP TABLE t1;
96 SET GLOBAl group_replication_autorejoin_tries = @group_replication_autorejoin_tries_save;
97 SET GLOBAl group_replication_components_stop_timeout = @group_replication_components_stop_timeout_save;
98 include/group_replication_end.inc