File: gr_blocked_start_gr_killed.test

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 (168 lines) | stat: -rw-r--r-- 5,633 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
################################################################################
# This test verifies that START GROUP_REPLICATION blocked
# due to disk full can be killed and unblocked.
#
# Test:
# 0. The test requires two servers M1 & M2
# 1. Setup GR environment and get thread id
#    of the query which will be killed.
# 2. Block START GR with no disk space.
# 3. Verify START GR is blocked.
# 4. Kill the blocked START GR command.
# 5. Reap the killed command and reset debug point.
# 6. Verify member is still OFFLINE
# 7. Verify no more thread is waiting for disk space
# 8. Restart group_replication on server1 and server2.
# 9. Add some data to server1.
# 10. Verify data is replicated to the group.
# 11. Clean up
################################################################################

--source include/big_test.inc
--source include/have_debug.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

--echo
--echo # 1. Setup GR environment and get thread id
--echo #    of the query which will be killed.
--echo
--let $rpl_connection_name= server1
--source include/rpl_connection.inc

# We RESET the channel here due to Bug#31541607. By executing this command
# here, we avoid a internal failure on START GROUP_REPLICATION that would
# fail while reseting this channel leading to a unclean channel state.
  --error 0, ER_REPLICA_CHANNEL_DOES_NOT_EXIST
RESET REPLICA FOR CHANNEL "group_replication_applier";

# Suppression of error messages
SET sql_log_bin=0;
CALL mtr.add_suppression("Error writing file.*(errno: 28 - No space left on device)");
CALL mtr.add_suppression("Disk is full writing.*(OS errno 28 - No space left on device)");
CALL mtr.add_suppression("Retry in 60 secs. Message reprinted in 600 secs");
CALL mtr.add_suppression("Unblocking the group replication thread waiting for applier to start, as the start group replication was killed");
CALL mtr.add_suppression("Unable to initialize the Group Replication applier module.");
CALL mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
CALL mtr.add_suppression("Failed in open_log.*called from Relay_log_info::rli_init_info");
CALL mtr.add_suppression("Failed to setup the group replication applier thread.");
call mtr.add_suppression("The group replication applier thread has received KILL request.");
CALL mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
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.");
CALL mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
SET sql_log_bin=1;

--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
SET GLOBAL group_replication_bootstrap_group=ON;

--let $conn_id=`SELECT CONNECTION_ID()`

--echo
--echo # 2. Block START GR with no disk space.
--echo
SET @debug_save= @@GLOBAL.DEBUG;
SET @@GLOBAL.DEBUG= 'd,simulate_file_write_error';

--send START GROUP_REPLICATION


--echo
--echo # 3. Verify START GR is blocked.
--echo
--let $rpl_connection_name= server_1
--source include/rpl_connection.inc

--let $wait_condition= SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE='starting' AND INFO='start group_replication';
--source include/wait_condition.inc

--let $wait_condition= SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE='Waiting for disk space';
--source include/wait_condition.inc


--echo
--echo # 4. Kill the blocked START GR command.
--echo
--replace_result $conn_id CONNECTION_ID
--eval KILL QUERY $conn_id


--echo
--echo # 5. Reap the killed command and reset debug point.
--echo
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--error ER_GROUP_REPLICATION_APPLIER_INIT_ERROR
--reap


SET @@GLOBAL.DEBUG= @debug_save;


--echo
--echo # 6. Verify member is still OFFLINE
--echo
--let $group_replication_member_state= OFFLINE
--source include/gr_wait_for_member_state.inc


--echo
--echo # 7. Verify no more thread is waiting for disk space
--echo
--let $wait_condition= SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE='Waiting for disk space';
--source include/wait_condition.inc


--echo
--echo # 8. Restart group_replication on server1 and server2.
--echo

--source include/start_and_bootstrap_group_replication.inc

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--source include/start_group_replication.inc


--echo
--echo # 9. Add some data to server1.
--echo

--let $rpl_connection_name= server1
--source include/rpl_connection.inc

CREATE TABLE test.t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO test.t1 VALUES (1);


--echo
--echo # 10. Verify data is replicated to the group.
--echo

# Wait for all servers to be in sync
--source include/rpl_sync.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc

--let $assert_text= Verify test.t1 is synced
--let $assert_cond= "[SELECT count(*) COUNT FROM test.t1, COUNT, 1]" = "1"
--source include/assert.inc


--let $rpl_connection_name= server2
--source include/rpl_connection.inc

--let $assert_text= Verify test.t1 is synced
--let $assert_cond= "[SELECT count(*) COUNT FROM test.t1, COUNT, 1]" = "1"
--source include/assert.inc


--echo
--echo # 11. Clean up
--echo

DROP TABLE t1;

--source include/group_replication_end.inc