File: gr_autorejoin_while_recovery_locked.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (98 lines) | stat: -rw-r--r-- 4,166 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
include/group_replication.inc [rpl_server_count=3]
Warnings:
Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
[connection server1]

# 1. Create table t1 on server1 with binlog disabled and bootstrap the
#    group
SET sql_log_bin=0;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT);
SET sql_log_bin=1;
include/start_and_bootstrap_group_replication.inc

# 2. Create table t1 on server2 with binlog disabled and join to the
#    group
[connection server2]
SET sql_log_bin=0;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT);
SET sql_log_bin=1;
include/start_group_replication.inc

# 3. Setup Server3.
#    Set the attempts of rejoin to 3 so we validate the process wont
#    block.
#    Reduce stop_component timeout so recovery module stops faster.
[connection server3]
SET @group_replication_autorejoin_tries_save = @@GLOBAL.group_replication_autorejoin_tries;
SET @group_replication_components_stop_timeout_save = @@GLOBAL.group_replication_components_stop_timeout;
SET GLOBAL group_replication_autorejoin_tries = 3;
SET GLOBAL group_replication_components_stop_timeout = 30;

# 4. Server3 disable binlog and supreess warnings, create table t1 and
#    get pid. Pid will be used to expel member from group
SET SESSION sql_log_bin= 0;
call mtr.add_suppression('On shutdown there was a timeout on the Group Replication recovery module termination. Check the log for more details');
call mtr.add_suppression('Member was expelled from the group due to network failures, changing member status to ERROR.');
call mtr.add_suppression('The server was automatically set into read only mode after an error was detected.');
call mtr.add_suppression("Error when stopping the group replication incremental recovery's donor connection");
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.');
CREATE TABLE pid_table(pid_no INT PRIMARY KEY);
LOAD DATA LOCAL INFILE 'pid_file' INTO TABLE pid_table;
DROP TABLE pid_table;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT);
SET SESSION sql_log_bin= 1;

# 5. Enable super read only, to avoid problem set it after FLUSH
#    TABLES WITH READ LOCK. Table locked will prevent server from
#    finishing recovery
[connection server_3]
SET GLOBAL super_read_only= 1;
FLUSH TABLES WITH READ LOCK;

# 6. Insert data on group
[connection server1]
INSERT INTO test.t1 VALUES (1, 1);
INSERT INTO test.t1 VALUES (2, 1);

# 7. Join server3 to group, it will stay on recovery due transactions
#    on group that it can't apply as the table is locked
[connection server3]
include/start_group_replication.inc

# 8. Wait until group_replication_recovery channel waits on table t1
#    commit lock

# 9. Expel server3 from the group
[connection server1]
include/rpl_gr_wait_for_number_of_members.inc
[connection server2]
include/rpl_gr_wait_for_number_of_members.inc
[connection server3]

# 10. Server3 should change is status to ERROR
include/gr_wait_for_member_state.inc

# 11. Waiting for two auto-rejoin attempts to happen, they will fail
#     due to recovery failing to stop

# 12. After the beginning of the second attempt server3 will stay in
#     ERROR state
include/gr_wait_for_member_state.inc

# 13. group_replication_recovery channel still waits on table t1
#     commit lock

# 14. UNLOCK tables on server3 and the join shall succeed
[connection server_3]
UNLOCK TABLES;

# 15. Server3 shall be ONLINE
[connection server3]
include/gr_wait_for_member_state.inc

# 16. Cleanup
DROP TABLE t1;
SET GLOBAl group_replication_autorejoin_tries = @group_replication_autorejoin_tries_save;
SET GLOBAl group_replication_components_stop_timeout = @group_replication_components_stop_timeout_save;
include/group_replication_end.inc