-
Notifications
You must be signed in to change notification settings - Fork 3.7k
/
notices_gr_join_leave.result
300 lines (283 loc) · 12 KB
/
notices_gr_join_leave.result
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
include/group_replication.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection server1]
[Setup XPlugin user on connection 'server1']
[Setup XPlugin user on connection 'server2']
## Protocol GR notices enabled - verify delivery of the notices
##########################################################################
###
### Sets up the group with two servers: server1 and server2
###
connecting...
active session is now 'verify_1'
connecting...
active session is now 'verify_2'
[connection verify_1]
[Enabling GR notifications]
[connection verify_2]
[Enabling GR notifications]
connecting...
active session is now 'server_1'
connecting...
active session is now 'server_2'
[connection server_2]
RUN SET GLOBAL group_replication_bootstrap_group= 0
[connection server_1]
RUN SET GLOBAL group_replication_bootstrap_group= 0
### Scenario 1: SERVER BOOTSTRAPS GROUP
### Expected:
### - Myself: 1 VIEW CHANGED, 2 STATE CHANGED
### - Others: N/A
##########################################################################
[connection server_1]
RUN SET GLOBAL group_replication_bootstrap_group= 1
RUN SET GLOBAL group_replication_group_name='%GR_NAME%'
RUN START GROUP_REPLICATION
[waiting for member_state to be equal 'ONLINE']
[connection server_2]
RUN SET GLOBAL group_replication_bootstrap_group= 0
[connection server_1]
RUN SET GLOBAL group_replication_bootstrap_group= 0
[ASSERT view_change on 'verify_1' connection]
[ASSERT state_change on 'verify_1' connection]
[ASSERT state_change on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_2' connection]
### Scenario 2: MEMBER JOINS, but blocks recovering
### Expected:
### - Myself: 1 VIEW CHANGED, 1 STATE CHANGED
### - Others: 1 VIEW CHANGED, 1 STATE CHANGED
##########################################################################
[connection server_2]
RUN SET @@GLOBAL.DEBUG='+d,recovery_thread_wait_before_finish'
RUN SET GLOBAL group_replication_group_name='%GR_NAME%'
RUN START GROUP_REPLICATION
[waiting for member_state to be equal 'RECOVERING']
[ASSERT view_change on 'verify_1' connection]
[ASSERT state_change on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT view_change on 'verify_2' connection]
[ASSERT state_change on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
### Scenario 3: MEMBER RECOVERS JOINS
### Expected:
### - Myself: 1 STATE CHANGED
### - Others: 1 STATE CHANGED
##########################################################################
[connection server_2]
RUN SET DEBUG_SYNC= "now WAIT_FOR signal.recovery_thread_wait_before_finish_reached"
RUN SET @@GLOBAL.DEBUG='-d,recovery_thread_wait_before_finish'
RUN SET DEBUG_SYNC= "now SIGNAL signal.recovery_end"
[waiting for member_state to be equal 'ONLINE']
RUN SET DEBUG_SYNC= 'RESET'
[ASSERT state_change on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT state_change on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
### Scenario 4: SERVER LEAVES(ERROR), SERVER LEAVES(OFFLINE)
### Expected:
### - Myself (leaving): 1 VIEW CHANGED, 1 STATE CHANGED
### - Others: 1 VIEW CHANGED
##########################################################################
[connection server_2]
RUN SET SESSION sql_log_bin=0
RUN CREATE TABLE test.tab1 (a INT PRIMARY KEY)
RUN SET SESSION sql_log_bin=1
[connection server_1]
RUN CREATE TABLE test.tab1 (a INT PRIMARY KEY)
[connection server_2]
[waiting for member_state to be equal 'ERROR']
[waiting for '1' members]
[ASSERT view_change on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT state_change on 'verify_2' connection]
[ASSERT view_change on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
[connection server_2]
RUN STOP GROUP_REPLICATION
RUN SET GLOBAL read_only= FALSE
[waiting for member_state to be equal 'OFFLINE']
[ASSERT state_change on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
### Cleanup: in xtest deallocation of GR and drop of data
##########################################################################
[connection server_1]
RUN STOP GROUP_REPLICATION
RUN SET GLOBAL read_only= FALSE
RUN DROP TABLE test.tab1
RUN RESET MASTER
[ASSERT view_change on 'verify_1' connection]
[ASSERT state_change on 'verify_1' connection]
[connection server_2]
RUN DROP TABLE test.tab1
RUN RESET MASTER
### Postcheck: Assert session status variables
### Expected:
### - Myself 10 global-notices (7 from the tests scenarios + 2 from cleanup + 1 from connection)
### - Other 7 global-notices (6 from the tests scenarios + 1 from connection)
##########################################################################
[connection verify_1]
RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 10]
RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 10]
RUN SHOW STATUS LIKE 'Mysqlx_notice_warning_sent';
Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
RUN SHOW STATUS LIKE 'Mysqlx_notice_other_sent';
Verify [Status variable "Mysqlx_notice_other_sent" needs to have a value of 4]
[connection verify_2]
RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 7]
RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 7]
RUN SHOW STATUS LIKE 'Mysqlx_notice_warning_sent';
Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
RUN SHOW STATUS LIKE 'Mysqlx_notice_other_sent';
Verify [Status variable "Mysqlx_notice_other_sent" needs to have a value of 4]
closing session verify_2
Mysqlx.Ok {
msg: "bye!"
}
ok
## X Protocol GR notices disabled - verify that X Plugin doesn't send the notices
##########################################################################
###
### Sets up the group with two servers: server1 and server2
###
connecting...
active session is now 'verify_1'
connecting...
active session is now 'verify_2'
connecting...
active session is now 'server_1'
connecting...
active session is now 'server_2'
[connection server_2]
RUN SET GLOBAL group_replication_bootstrap_group= 0
[connection server_1]
RUN SET GLOBAL group_replication_bootstrap_group= 0
### Scenario 1: SERVER BOOTSTRAPS GROUP
### Expected:
### - Myself: 1 VIEW CHANGED, 2 STATE CHANGED
### - Others: N/A
##########################################################################
[connection server_1]
RUN SET GLOBAL group_replication_bootstrap_group= 1
RUN SET GLOBAL group_replication_group_name='%GR_NAME%'
RUN START GROUP_REPLICATION
[waiting for member_state to be equal 'ONLINE']
[connection server_2]
RUN SET GLOBAL group_replication_bootstrap_group= 0
[connection server_1]
RUN SET GLOBAL group_replication_bootstrap_group= 0
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_2' connection]
### Scenario 2: MEMBER JOINS, but blocks recovering
### Expected:
### - Myself: 1 VIEW CHANGED, 1 STATE CHANGED
### - Others: 1 VIEW CHANGED, 1 STATE CHANGED
##########################################################################
[connection server_2]
RUN SET @@GLOBAL.DEBUG='+d,recovery_thread_wait_before_finish'
RUN SET GLOBAL group_replication_group_name='%GR_NAME%'
RUN START GROUP_REPLICATION
[waiting for member_state to be equal 'RECOVERING']
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
### Scenario 3: MEMBER RECOVERS JOINS
### Expected:
### - Myself: 1 STATE CHANGED
### - Others: 1 STATE CHANGED
##########################################################################
[connection server_2]
RUN SET DEBUG_SYNC= "now WAIT_FOR signal.recovery_thread_wait_before_finish_reached"
RUN SET @@GLOBAL.DEBUG='-d,recovery_thread_wait_before_finish'
RUN SET DEBUG_SYNC= "now SIGNAL signal.recovery_end"
[waiting for member_state to be equal 'ONLINE']
RUN SET DEBUG_SYNC= 'RESET'
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
### Scenario 4: SERVER LEAVES(ERROR), SERVER LEAVES(OFFLINE)
### Expected:
### - Myself (leaving): 1 VIEW CHANGED, 1 STATE CHANGED
### - Others: 1 VIEW CHANGED
##########################################################################
[connection server_2]
RUN SET SESSION sql_log_bin=0
RUN CREATE TABLE test.tab1 (a INT PRIMARY KEY)
RUN SET SESSION sql_log_bin=1
[connection server_1]
RUN CREATE TABLE test.tab1 (a INT PRIMARY KEY)
[connection server_2]
[waiting for member_state to be equal 'ERROR']
[waiting for '1' members]
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
[connection server_2]
RUN STOP GROUP_REPLICATION
RUN SET GLOBAL read_only= FALSE
[waiting for member_state to be equal 'OFFLINE']
[ASSERT no notices on 'verify_2' connection]
[ASSERT no notices on 'verify_2' connection]
### Cleanup: in xtest deallocation of GR and drop of data
##########################################################################
[connection server_1]
RUN STOP GROUP_REPLICATION
RUN SET GLOBAL read_only= FALSE
RUN DROP TABLE test.tab1
RUN RESET MASTER
[ASSERT no notices on 'verify_1' connection]
[ASSERT no notices on 'verify_1' connection]
[connection server_2]
RUN DROP TABLE test.tab1
RUN RESET MASTER
### Postcheck: Assert session status variables
### Expected:
### - Myself 10 global-notices (7 from the tests scenarios + 2 from cleanup + 1 from connection)
### - Other 7 global-notices (6 from the tests scenarios + 1 from connection)
##########################################################################
[connection verify_1]
RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 1]
RUN SHOW STATUS LIKE 'Mysqlx_notice_warning_sent';
Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
RUN SHOW STATUS LIKE 'Mysqlx_notice_other_sent';
Verify [Status variable "Mysqlx_notice_other_sent" needs to have a value of 3]
[connection verify_2]
RUN SHOW STATUS LIKE 'Mysqlx_notice_global_sent';
Verify [Status variable "Mysqlx_notice_global_sent" needs to have a value of 1]
RUN SHOW STATUS LIKE 'Mysqlx_notice_warning_sent';
Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
RUN SHOW STATUS LIKE 'Mysqlx_notice_other_sent';
Verify [Status variable "Mysqlx_notice_other_sent" needs to have a value of 3]
closing session verify_2
Mysqlx.Ok {
msg: "bye!"
}
ok
## Assert global status variables responsible for monitoring of global notices
## Expected:
## - Global Mysqlx_notified_by_group_replication must be two times higher than
## the session Mysqlx_notice_global_sent (test was executed two times).
##########################################################################
[connection server1]
include/assert.inc [Verify if the number of send global notices matches Mysqlx_notice_global_sent.]
include/assert.inc [Verify if the number of send global notices matches Mysqlx_notified_by_group_replication.]
[connection server2]
include/assert.inc [Verify if the number of send global notices matches Mysqlx_notice_global_sent.]
include/assert.inc [Verify if the number of send global notices matches Mysqlx_notified_by_group_replication.]
include/group_replication_end.inc