Debian Codegraph @

mysql-test/suite/ndb/r/ndb_fully_replicated_restart2.result

raw
1 Test that fully-replicated tables are still functioning
2 correctly after various restart types.
3 Checks read-locality, and copy-fragment maintenance
4 ndb_fully_replicated_restart2.inc (NR)
5 Create FR table
6 use test;
7 create table test.t1 (
8 a int primary key,
9 b int,
10 c int,
11 d int,
12 unique(c), key(d))
13 comment="NDB_TABLE=FULLY_REPLICATED=1" engine=ndb;
14 Put some stuff into it
15 *************************
16 Pre-restart checks
17 *************************
18 Check row count
19 select count(1) from test.t1 into @row_count;
20 select @row_count;
21 @row_count
22 5120
23 Show physical rows per logical row (NoOfReplicas * NumNodeGroups)
24 select floor(sum(fixed_elem_count) / @row_count) as phys_rows_per_row
25 from ndbinfo.memory_per_fragment
26 where fq_name='test/def/t1' into @prpr;
27 select @prpr;
28 @prpr
29 4
30 Check row count
31 select count(1) from test.t1 into @row_count;
32 select @row_count;
33 @row_count
34 5120
35 Check Physical row count against expected
36 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
37 set @diff = (@row_count * @prpr) - @sum;
38 select floor(@row_count * @prpr) as expected_phys_rows,
39 @sum as actual_phys_rows,
40 @diff as diff;
41 expected_phys_rows actual_phys_rows diff
42 20480 20480 0
43 Check UI physical row count against expected
44 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
45 set @diff = (@row_count * @prpr) - @sum;
46 select floor(@row_count * @prpr) as expected_phys_rows,
47 @sum as actual_phys_rows,
48 @diff as diff;
49 expected_phys_rows actual_phys_rows diff
50 20480 20480 0
51 Delete some data
52 delete from test.t1 limit 512;
53 Show new logical row count
54 select count(1) from test.t1 into @new_row_count;
55 select @new_row_count;
56 @new_row_count
57 4608
58 Check new Physical row count against expected
59 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
60 set @diff = (@new_row_count * @prpr) - @sum;
61 select floor(@new_row_count * @prpr) as expected_phys_rows,
62 @sum as actual_phys_rows,
63 @diff as diff;
64 expected_phys_rows actual_phys_rows diff
65 18432 18432 0
66 Check UI physical row count against expected
67 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
68 set @diff = (@new_row_count * @prpr) - @sum;
69 select floor(@new_row_count * @prpr) as expected_phys_rows,
70 @sum as actual_phys_rows,
71 @diff as diff;
72 expected_phys_rows actual_phys_rows diff
73 18432 18432 0
74 Insert some data
75 Show new logical row count
76 select count(1) from test.t1 into @new_row_count;
77 select @new_row_count;
78 @new_row_count
79 5408
80 Check new Physical row count against expected
81 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
82 set @diff = (@new_row_count * @prpr) - @sum;
83 select floor(@new_row_count * @prpr) as expected_phys_rows,
84 @sum as actual_phys_rows,
85 @diff as diff;
86 expected_phys_rows actual_phys_rows diff
87 21632 21632 0
88 Check UI physical row count against expected
89 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
90 set @diff = (@new_row_count * @prpr) - @sum;
91 select floor(@new_row_count * @prpr) as expected_phys_rows,
92 @sum as actual_phys_rows,
93 @diff as diff;
94 expected_phys_rows actual_phys_rows diff
95 21632 21632 0
96 Show read-locality at all data nodes
97 create table test.t2(a int primary key) engine=ndb;
98 insert into test.t2 values (1);
99 create table nodes(id int primary key);
100 Expect that the transaction ran on all 4 nodes :
101 select count(1) from nodes;
102 count(1)
103 4
104 drop table nodes;
105 drop table test.t2;
106 Now perform a rolling restart
107 Node 1
108 Node 1: STARTED
109 Node 2: STARTED
110 Node 3: STARTED
111 Node 4: STARTED
112 Node 2
113 Node 1: STARTED
114 Node 2: STARTED
115 Node 3: STARTED
116 Node 4: STARTED
117 Node 3
118 Node 1: STARTED
119 Node 2: STARTED
120 Node 3: STARTED
121 Node 4: STARTED
122 Node 4
123 Node 1: STARTED
124 Node 2: STARTED
125 Node 3: STARTED
126 Node 4: STARTED
127 --- Wait to establish connection
128 **************************
129 Post-restart checks
130 **************************
131 Check row count
132 select count(1) from test.t1 into @row_count;
133 select @row_count;
134 @row_count
135 5408
136 Check Physical row count against expected
137 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
138 set @diff = (@row_count * @prpr) - @sum;
139 select floor(@row_count * @prpr) as expected_phys_rows,
140 @sum as actual_phys_rows,
141 @diff as diff;
142 expected_phys_rows actual_phys_rows diff
143 21632 21632 0
144 Check UI physical row count against expected
145 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
146 set @diff = (@row_count * @prpr) - @sum;
147 select floor(@row_count * @prpr) as expected_phys_rows,
148 @sum as actual_phys_rows,
149 @diff as diff;
150 expected_phys_rows actual_phys_rows diff
151 21632 21632 0
152 Delete some data
153 delete from test.t1 limit 512;
154 Show new logical row count
155 select count(1) from test.t1 into @new_row_count;
156 select @new_row_count;
157 @new_row_count
158 4896
159 Check new Physical row count against expected
160 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
161 set @diff = (@new_row_count * @prpr) - @sum;
162 select floor(@new_row_count * @prpr) as expected_phys_rows,
163 @sum as actual_phys_rows,
164 @diff as diff;
165 expected_phys_rows actual_phys_rows diff
166 19584 19584 0
167 Check UI physical row count against expected
168 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
169 set @diff = (@new_row_count * @prpr) - @sum;
170 select floor(@new_row_count * @prpr) as expected_phys_rows,
171 @sum as actual_phys_rows,
172 @diff as diff;
173 expected_phys_rows actual_phys_rows diff
174 19584 19584 0
175 Insert some data
176 Show new logical row count
177 select count(1) from test.t1 into @new_row_count;
178 select @new_row_count;
179 @new_row_count
180 5696
181 Check new Physical row count against expected
182 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
183 set @diff = (@new_row_count * @prpr) - @sum;
184 select floor(@new_row_count * @prpr) as expected_phys_rows,
185 @sum as actual_phys_rows,
186 @diff as diff;
187 expected_phys_rows actual_phys_rows diff
188 22784 22784 0
189 Check UI physical row count against expected
190 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
191 set @diff = (@new_row_count * @prpr) - @sum;
192 select floor(@new_row_count * @prpr) as expected_phys_rows,
193 @sum as actual_phys_rows,
194 @diff as diff;
195 expected_phys_rows actual_phys_rows diff
196 22784 22784 0
197 Show read-locality at all data nodes
198 create table test.t2(a int primary key) engine=ndb;
199 insert into test.t2 values (1);
200 create table nodes(id int primary key);
201 Expect that the transaction ran on all 4 nodes :
202 select count(1) from nodes;
203 count(1)
204 4
205 drop table nodes;
206 drop table test.t2;
207 Delete the lot
208 delete from test.t1 limit 1024;
209 delete from test.t1 limit 1024;
210 delete from test.t1 limit 1024;
211 delete from test.t1 limit 1024;
212 delete from test.t1 limit 1024;
213 delete from test.t1 limit 1024;
214 select count(1) from test.t1 into @new_row_count;
215 select @new_row_count;
216 @new_row_count
217 0
218 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1';
219 sum(fixed_elem_count)
220 0
221 Check new Physical row count against expected
222 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
223 set @diff = (@new_row_count * @prpr) - @sum;
224 select floor(@new_row_count * @prpr) as expected_phys_rows,
225 @sum as actual_phys_rows,
226 @diff as diff;
227 expected_phys_rows actual_phys_rows diff
228 0 0 0
229 Check UI physical row count against expected
230 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
231 set @diff = (@new_row_count * @prpr) - @sum;
232 select floor(@new_row_count * @prpr) as expected_phys_rows,
233 @sum as actual_phys_rows,
234 @diff as diff;
235 expected_phys_rows actual_phys_rows diff
236 0 0 0
237 drop table test.t1;
238 ndb_fully_replicated_restart2.inc (SRTO)
239 Create FR table
240 use test;
241 create table test.t1 (
242 a int primary key,
243 b int,
244 c int,
245 d int,
246 unique(c), key(d))
247 comment="NDB_TABLE=FULLY_REPLICATED=1" engine=ndb;
248 Put some stuff into it
249 *************************
250 Pre-restart checks
251 *************************
252 Check row count
253 select count(1) from test.t1 into @row_count;
254 select @row_count;
255 @row_count
256 5120
257 Show physical rows per logical row (NoOfReplicas * NumNodeGroups)
258 select floor(sum(fixed_elem_count) / @row_count) as phys_rows_per_row
259 from ndbinfo.memory_per_fragment
260 where fq_name='test/def/t1' into @prpr;
261 select @prpr;
262 @prpr
263 4
264 Check row count
265 select count(1) from test.t1 into @row_count;
266 select @row_count;
267 @row_count
268 5120
269 Check Physical row count against expected
270 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
271 set @diff = (@row_count * @prpr) - @sum;
272 select floor(@row_count * @prpr) as expected_phys_rows,
273 @sum as actual_phys_rows,
274 @diff as diff;
275 expected_phys_rows actual_phys_rows diff
276 20480 20480 0
277 Check UI physical row count against expected
278 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
279 set @diff = (@row_count * @prpr) - @sum;
280 select floor(@row_count * @prpr) as expected_phys_rows,
281 @sum as actual_phys_rows,
282 @diff as diff;
283 expected_phys_rows actual_phys_rows diff
284 20480 20480 0
285 Delete some data
286 delete from test.t1 limit 512;
287 Show new logical row count
288 select count(1) from test.t1 into @new_row_count;
289 select @new_row_count;
290 @new_row_count
291 4608
292 Check new Physical row count against expected
293 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
294 set @diff = (@new_row_count * @prpr) - @sum;
295 select floor(@new_row_count * @prpr) as expected_phys_rows,
296 @sum as actual_phys_rows,
297 @diff as diff;
298 expected_phys_rows actual_phys_rows diff
299 18432 18432 0
300 Check UI physical row count against expected
301 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
302 set @diff = (@new_row_count * @prpr) - @sum;
303 select floor(@new_row_count * @prpr) as expected_phys_rows,
304 @sum as actual_phys_rows,
305 @diff as diff;
306 expected_phys_rows actual_phys_rows diff
307 18432 18432 0
308 Insert some data
309 Show new logical row count
310 select count(1) from test.t1 into @new_row_count;
311 select @new_row_count;
312 @new_row_count
313 5408
314 Check new Physical row count against expected
315 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
316 set @diff = (@new_row_count * @prpr) - @sum;
317 select floor(@new_row_count * @prpr) as expected_phys_rows,
318 @sum as actual_phys_rows,
319 @diff as diff;
320 expected_phys_rows actual_phys_rows diff
321 21632 21632 0
322 Check UI physical row count against expected
323 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
324 set @diff = (@new_row_count * @prpr) - @sum;
325 select floor(@new_row_count * @prpr) as expected_phys_rows,
326 @sum as actual_phys_rows,
327 @diff as diff;
328 expected_phys_rows actual_phys_rows diff
329 21632 21632 0
330 Show read-locality at all data nodes
331 create table test.t2(a int primary key) engine=ndb;
332 insert into test.t2 values (1);
333 create table nodes(id int primary key);
334 Expect that the transaction ran on all 4 nodes :
335 select count(1) from nodes;
336 count(1)
337 4
338 drop table nodes;
339 drop table test.t2;
340 Now perform SR with takeover
341 Node 1 restart -n
342 Wait for Node 1 to enter NOSTART state
343 Node 1: NOT_STARTED
344 Now make some change and trigger some LCP action
345 Now bring down the other nodes
346 Wait for them to come down
347 Node 1: NOT_STARTED
348 Node 2: NOT_STARTED
349 Node 3: NOT_STARTED
350 Node 4: NOT_STARTED
351 Now start-em up
352 Wait for SR to complete
353 Node 1: STARTED
354 Node 2: STARTED
355 Node 3: STARTED
356 Node 4: STARTED
357 --- Wait to establish connection
358 **************************
359 Post-restart checks
360 **************************
361 Check row count
362 select count(1) from test.t1 into @row_count;
363 select @row_count;
364 @row_count
365 5408
366 Check Physical row count against expected
367 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
368 set @diff = (@row_count * @prpr) - @sum;
369 select floor(@row_count * @prpr) as expected_phys_rows,
370 @sum as actual_phys_rows,
371 @diff as diff;
372 expected_phys_rows actual_phys_rows diff
373 21632 21632 0
374 Check UI physical row count against expected
375 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
376 set @diff = (@row_count * @prpr) - @sum;
377 select floor(@row_count * @prpr) as expected_phys_rows,
378 @sum as actual_phys_rows,
379 @diff as diff;
380 expected_phys_rows actual_phys_rows diff
381 21632 21632 0
382 Delete some data
383 delete from test.t1 limit 512;
384 Show new logical row count
385 select count(1) from test.t1 into @new_row_count;
386 select @new_row_count;
387 @new_row_count
388 4896
389 Check new Physical row count against expected
390 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
391 set @diff = (@new_row_count * @prpr) - @sum;
392 select floor(@new_row_count * @prpr) as expected_phys_rows,
393 @sum as actual_phys_rows,
394 @diff as diff;
395 expected_phys_rows actual_phys_rows diff
396 19584 19584 0
397 Check UI physical row count against expected
398 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
399 set @diff = (@new_row_count * @prpr) - @sum;
400 select floor(@new_row_count * @prpr) as expected_phys_rows,
401 @sum as actual_phys_rows,
402 @diff as diff;
403 expected_phys_rows actual_phys_rows diff
404 19584 19584 0
405 Insert some data
406 Show new logical row count
407 select count(1) from test.t1 into @new_row_count;
408 select @new_row_count;
409 @new_row_count
410 5696
411 Check new Physical row count against expected
412 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
413 set @diff = (@new_row_count * @prpr) - @sum;
414 select floor(@new_row_count * @prpr) as expected_phys_rows,
415 @sum as actual_phys_rows,
416 @diff as diff;
417 expected_phys_rows actual_phys_rows diff
418 22784 22784 0
419 Check UI physical row count against expected
420 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
421 set @diff = (@new_row_count * @prpr) - @sum;
422 select floor(@new_row_count * @prpr) as expected_phys_rows,
423 @sum as actual_phys_rows,
424 @diff as diff;
425 expected_phys_rows actual_phys_rows diff
426 22784 22784 0
427 Show read-locality at all data nodes
428 create table test.t2(a int primary key) engine=ndb;
429 insert into test.t2 values (1);
430 create table nodes(id int primary key);
431 Expect that the transaction ran on all 4 nodes :
432 select count(1) from nodes;
433 count(1)
434 4
435 drop table nodes;
436 drop table test.t2;
437 Delete the lot
438 delete from test.t1 limit 1024;
439 delete from test.t1 limit 1024;
440 delete from test.t1 limit 1024;
441 delete from test.t1 limit 1024;
442 delete from test.t1 limit 1024;
443 delete from test.t1 limit 1024;
444 select count(1) from test.t1 into @new_row_count;
445 select @new_row_count;
446 @new_row_count
447 0
448 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1';
449 sum(fixed_elem_count)
450 0
451 Check new Physical row count against expected
452 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where fq_name='test/def/t1' into @sum;
453 set @diff = (@new_row_count * @prpr) - @sum;
454 select floor(@new_row_count * @prpr) as expected_phys_rows,
455 @sum as actual_phys_rows,
456 @diff as diff;
457 expected_phys_rows actual_phys_rows diff
458 0 0 0
459 Check UI physical row count against expected
460 select sum(fixed_elem_count) from ndbinfo.memory_per_fragment where parent_fq_name='test/def/t1' and fq_name like '%/c$unique' into @sum;
461 set @diff = (@new_row_count * @prpr) - @sum;
462 select floor(@new_row_count * @prpr) as expected_phys_rows,
463 @sum as actual_phys_rows,
464 @diff as diff;
465 expected_phys_rows actual_phys_rows diff
466 0 0 0
467 drop table test.t1;