Debian Codegraph @

mysql-test/suite/x/r/notices_gr_join_leave.result

raw
1 include/group_replication.inc
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 [Setup XPlugin user on connection 'server1']
7 [Setup XPlugin user on connection 'server2']
8
9 ## Protocol GR notices enabled - verify delivery of the notices
10 ##########################################################################
11
12 ###
13 ### Sets up the group with two servers: server1 and server2
14 ###
15 connecting...
16 active session is now 'verify_1'
17 connecting...
18 active session is now 'verify_2'
19 [connection verify_1]
20 [Enabling GR notifications]
21 [connection verify_2]
22 [Enabling GR notifications]
23 connecting...
24 active session is now 'server_1'
25 connecting...
26 active session is now 'server_2'
27 [connection server_2]
28 RUN SET GLOBAL group_replication_bootstrap_group= 0
29 [connection server_1]
30 RUN SET GLOBAL group_replication_bootstrap_group= 0
31
32 ### Scenario 1: SERVER BOOTSTRAPS GROUP
33 ### Expected:
34 ### - Myself: 1 VIEW CHANGED, 2 STATE CHANGED
35 ### - Others: N/A
36 ##########################################################################
37 [connection server_1]
38 RUN SET GLOBAL group_replication_bootstrap_group= 1
39 RUN SET GLOBAL group_replication_group_name='%GR_NAME%'
40 RUN START GROUP_REPLICATION
41 [waiting for member_state to be equal 'ONLINE']
42 [connection server_2]
43 RUN SET GLOBAL group_replication_bootstrap_group= 0
44 [connection server_1]
45 RUN SET GLOBAL group_replication_bootstrap_group= 0
46 [ASSERT view_change on 'verify_1' connection]
47 [ASSERT state_change on 'verify_1' connection]
48 [ASSERT state_change on 'verify_1' connection]
49 [ASSERT no notices on 'verify_1' connection]
50 [ASSERT no notices on 'verify_2' connection]
51
52 ### Scenario 2: MEMBER JOINS, but blocks recovering
53 ### Expected:
54 ### - Myself: 1 VIEW CHANGED, 1 STATE CHANGED
55 ### - Others: 1 VIEW CHANGED, 1 STATE CHANGED
56 ##########################################################################
57 [connection server_2]
58 RUN SET @@GLOBAL.DEBUG='+d,recovery_thread_wait_before_finish'
59 RUN SET GLOBAL group_replication_group_name='%GR_NAME%'
60 RUN START GROUP_REPLICATION
61 [waiting for member_state to be equal 'RECOVERING']
62 [ASSERT view_change on 'verify_1' connection]
63 [ASSERT state_change on 'verify_1' connection]
64 [ASSERT no notices on 'verify_1' connection]
65 [ASSERT view_change on 'verify_2' connection]
66 [ASSERT state_change on 'verify_2' connection]
67 [ASSERT no notices on 'verify_2' connection]
68
69 ### Scenario 3: MEMBER RECOVERS JOINS
70 ### Expected:
71 ### - Myself: 1 STATE CHANGED
72 ### - Others: 1 STATE CHANGED
73 ##########################################################################
74 [connection server_2]
75 RUN SET DEBUG_SYNC= "now WAIT_FOR signal.recovery_thread_wait_before_finish_reached"
76 RUN SET @@GLOBAL.DEBUG='-d,recovery_thread_wait_before_finish'
77 RUN SET DEBUG_SYNC= "now SIGNAL signal.recovery_end"
78 [waiting for member_state to be equal 'ONLINE']
79 RUN SET DEBUG_SYNC= 'RESET'
80 [ASSERT state_change on 'verify_1' connection]
81 [ASSERT no notices on 'verify_1' connection]
82 [ASSERT state_change on 'verify_2' connection]
83 [ASSERT no notices on 'verify_2' connection]
84
85 ### Scenario 4: SERVER LEAVES(ERROR), SERVER LEAVES(OFFLINE)
86 ### Expected:
87 ### - Myself (leaving): 1 VIEW CHANGED, 1 STATE CHANGED
88 ### - Others: 1 VIEW CHANGED
89 ##########################################################################
90 [connection server_2]
91 RUN SET SESSION sql_log_bin=0
92 RUN CREATE TABLE test.tab1 (a INT PRIMARY KEY)
93 RUN SET SESSION sql_log_bin=1
94 [connection server_1]
95 RUN CREATE TABLE test.tab1 (a INT PRIMARY KEY)
96 [connection server_2]
97 [waiting for member_state to be equal 'ERROR']
98 [waiting for '1' members]
99 [ASSERT view_change on 'verify_1' connection]
100 [ASSERT no notices on 'verify_1' connection]
101 [ASSERT state_change on 'verify_2' connection]
102 [ASSERT view_change on 'verify_2' connection]
103 [ASSERT no notices on 'verify_2' connection]
104 [connection server_2]
105 RUN STOP GROUP_REPLICATION
106 RUN SET GLOBAL read_only= FALSE
107 [waiting for member_state to be equal 'OFFLINE']
108 [ASSERT state_change on 'verify_2' connection]
109 [ASSERT no notices on 'verify_2' connection]
110
111 ### Cleanup: in xtest deallocation of GR and drop of data
112 ##########################################################################
113 [connection server_1]
114 RUN STOP GROUP_REPLICATION
115 RUN SET GLOBAL read_only= FALSE
116 RUN DROP TABLE test.tab1
117 RUN RESET MASTER
118 [ASSERT view_change on 'verify_1' connection]
119 [ASSERT state_change on 'verify_1' connection]
120 [connection server_2]
121 RUN DROP TABLE test.tab1
122 RUN RESET MASTER
123
124 ### Postcheck: Assert session status variables
125 ### Expected:
126 ### - Myself 10 global-notices (7 from the tests scenarios + 2 from cleanup + 1 from connection)
127 ### - Other 7 global-notices (6 from the tests scenarios + 1 from connection)
128 ##########################################################################
129 [connection verify_1]
130 RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
131 Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 10]
132 RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
133 Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 10]
134 RUN SHOW STATUS LIKE 'Mysqlx_notice_warning_sent';
135 Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
136 RUN SHOW STATUS LIKE 'Mysqlx_notice_other_sent';
137 Verify [Status variable "Mysqlx_notice_other_sent" needs to have a value of 4]
138 [connection verify_2]
139 RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
140 Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 7]
141 RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
142 Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 7]
143 RUN SHOW STATUS LIKE 'Mysqlx_notice_warning_sent';
144 Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
145 RUN SHOW STATUS LIKE 'Mysqlx_notice_other_sent';
146 Verify [Status variable "Mysqlx_notice_other_sent" needs to have a value of 4]
147 closing session verify_2
148 Mysqlx.Ok {
149 msg: "bye!"
150 }
151 ok
152
153 ## X Protocol GR notices disabled - verify that X Plugin doesn't send the notices
154 ##########################################################################
155
156 ###
157 ### Sets up the group with two servers: server1 and server2
158 ###
159 connecting...
160 active session is now 'verify_1'
161 connecting...
162 active session is now 'verify_2'
163 connecting...
164 active session is now 'server_1'
165 connecting...
166 active session is now 'server_2'
167 [connection server_2]
168 RUN SET GLOBAL group_replication_bootstrap_group= 0
169 [connection server_1]
170 RUN SET GLOBAL group_replication_bootstrap_group= 0
171
172 ### Scenario 1: SERVER BOOTSTRAPS GROUP
173 ### Expected:
174 ### - Myself: 1 VIEW CHANGED, 2 STATE CHANGED
175 ### - Others: N/A
176 ##########################################################################
177 [connection server_1]
178 RUN SET GLOBAL group_replication_bootstrap_group= 1
179 RUN SET GLOBAL group_replication_group_name='%GR_NAME%'
180 RUN START GROUP_REPLICATION
181 [waiting for member_state to be equal 'ONLINE']
182 [connection server_2]
183 RUN SET GLOBAL group_replication_bootstrap_group= 0
184 [connection server_1]
185 RUN SET GLOBAL group_replication_bootstrap_group= 0
186 [ASSERT no notices on 'verify_1' connection]
187 [ASSERT no notices on 'verify_1' connection]
188 [ASSERT no notices on 'verify_1' connection]
189 [ASSERT no notices on 'verify_1' connection]
190 [ASSERT no notices on 'verify_2' connection]
191
192 ### Scenario 2: MEMBER JOINS, but blocks recovering
193 ### Expected:
194 ### - Myself: 1 VIEW CHANGED, 1 STATE CHANGED
195 ### - Others: 1 VIEW CHANGED, 1 STATE CHANGED
196 ##########################################################################
197 [connection server_2]
198 RUN SET @@GLOBAL.DEBUG='+d,recovery_thread_wait_before_finish'
199 RUN SET GLOBAL group_replication_group_name='%GR_NAME%'
200 RUN START GROUP_REPLICATION
201 [waiting for member_state to be equal 'RECOVERING']
202 [ASSERT no notices on 'verify_1' connection]
203 [ASSERT no notices on 'verify_1' connection]
204 [ASSERT no notices on 'verify_1' connection]
205 [ASSERT no notices on 'verify_2' connection]
206 [ASSERT no notices on 'verify_2' connection]
207 [ASSERT no notices on 'verify_2' connection]
208
209 ### Scenario 3: MEMBER RECOVERS JOINS
210 ### Expected:
211 ### - Myself: 1 STATE CHANGED
212 ### - Others: 1 STATE CHANGED
213 ##########################################################################
214 [connection server_2]
215 RUN SET DEBUG_SYNC= "now WAIT_FOR signal.recovery_thread_wait_before_finish_reached"
216 RUN SET @@GLOBAL.DEBUG='-d,recovery_thread_wait_before_finish'
217 RUN SET DEBUG_SYNC= "now SIGNAL signal.recovery_end"
218 [waiting for member_state to be equal 'ONLINE']
219 RUN SET DEBUG_SYNC= 'RESET'
220 [ASSERT no notices on 'verify_1' connection]
221 [ASSERT no notices on 'verify_1' connection]
222 [ASSERT no notices on 'verify_2' connection]
223 [ASSERT no notices on 'verify_2' connection]
224
225 ### Scenario 4: SERVER LEAVES(ERROR), SERVER LEAVES(OFFLINE)
226 ### Expected:
227 ### - Myself (leaving): 1 VIEW CHANGED, 1 STATE CHANGED
228 ### - Others: 1 VIEW CHANGED
229 ##########################################################################
230 [connection server_2]
231 RUN SET SESSION sql_log_bin=0
232 RUN CREATE TABLE test.tab1 (a INT PRIMARY KEY)
233 RUN SET SESSION sql_log_bin=1
234 [connection server_1]
235 RUN CREATE TABLE test.tab1 (a INT PRIMARY KEY)
236 [connection server_2]
237 [waiting for member_state to be equal 'ERROR']
238 [waiting for '1' members]
239 [ASSERT no notices on 'verify_1' connection]
240 [ASSERT no notices on 'verify_1' connection]
241 [ASSERT no notices on 'verify_2' connection]
242 [ASSERT no notices on 'verify_2' connection]
243 [ASSERT no notices on 'verify_2' connection]
244 [connection server_2]
245 RUN STOP GROUP_REPLICATION
246 RUN SET GLOBAL read_only= FALSE
247 [waiting for member_state to be equal 'OFFLINE']
248 [ASSERT no notices on 'verify_2' connection]
249 [ASSERT no notices on 'verify_2' connection]
250
251 ### Cleanup: in xtest deallocation of GR and drop of data
252 ##########################################################################
253 [connection server_1]
254 RUN STOP GROUP_REPLICATION
255 RUN SET GLOBAL read_only= FALSE
256 RUN DROP TABLE test.tab1
257 RUN RESET MASTER
258 [ASSERT no notices on 'verify_1' connection]
259 [ASSERT no notices on 'verify_1' connection]
260 [connection server_2]
261 RUN DROP TABLE test.tab1
262 RUN RESET MASTER
263
264 ### Postcheck: Assert session status variables
265 ### Expected:
266 ### - Myself 10 global-notices (7 from the tests scenarios + 2 from cleanup + 1 from connection)
267 ### - Other 7 global-notices (6 from the tests scenarios + 1 from connection)
268 ##########################################################################
269 [connection verify_1]
270 RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
271 Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 1]
272 RUN SHOW STATUS LIKE 'Mysqlx_notice_warning_sent';
273 Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
274 RUN SHOW STATUS LIKE 'Mysqlx_notice_other_sent';
275 Verify [Status variable "Mysqlx_notice_other_sent" needs to have a value of 3]
276 [connection verify_2]
277 RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
278 Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 1]
279 RUN SHOW STATUS LIKE 'Mysqlx_notice_warning_sent';
280 Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
281 RUN SHOW STATUS LIKE 'Mysqlx_notice_other_sent';
282 Verify [Status variable "Mysqlx_notice_other_sent" needs to have a value of 3]
283 closing session verify_2
284 Mysqlx.Ok {
285 msg: "bye!"
286 }
287 ok
288
289 ## Assert global status variables responsible for monitoring of global notices
290 ## Expected:
291 ## - Global Mysqlx_notified_by_group_replication must be two times higher than
292 ## the session Mysqlx_notice_global_sent (test was executed two times).
293 ##########################################################################
294 [connection server1]
295 include/assert.inc [Verify if the number of send global notices matches Mysqlx_notice_global_sent.]
296 include/assert.inc [Verify if the number of send global notices matches Mysqlx_notified_by_group_replication.]
297 [connection server2]
298 include/assert.inc [Verify if the number of send global notices matches Mysqlx_notice_global_sent.]
299 include/assert.inc [Verify if the number of send global notices matches Mysqlx_notified_by_group_replication.]
300 include/group_replication_end.inc