Debian Codegraph @

mysql-test/suite/ndb_rpl/r/ndb_rpl_conflict_epoch.result

raw
1 include/master-slave.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 master]
6 Setup circular replication
7 The circle is setup between Primary and Secondary
8 Setup ndb_replication and t1 exceptions table
9 Populate ndb_replication table as necessary
10 -- 0 extra gci bits
11 create table `test`.`t1$EX`
12 (server_id int unsigned,
13 master_server_id int unsigned,
14 master_epoch bigint unsigned,
15 count int unsigned,
16 a int not null,
17 d int,
18 primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
19 Create table
20 create table test.t1(a int primary key, b varchar(255)) engine = ndb;
21 Create other table
22 create table test.t2(a int primary key, b int) engine = ndb;
23 ----------------------------------
24 Test 1 : Basic two-way replication
25 ----------------------------------
26 insert into test.t1 values (1, "Metropole");
27 FLUSH LOGS;
28 -- Verify that Max rep epoch has been updated
29 -- Primary Cluster Max Rep Epoch now beyond the original update epoch
30 -- Now update data on slave
31 update test.t1 set b="Favorit" where a=1;
32 -- Now check data on Primary
33 select * from test.t1 order by a;
34 a b
35 1 Favorit
36 Conflict algorithm counter diff :
37 Exception table contents
38 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
39 server_id master_server_id master_epoch count a d
40 SELECT * FROM `t1$EX` ORDER BY a, d;
41 server_id master_server_id master_epoch count a d
42 -- Now perform multiple consecutive updates on the Secondary
43 update test.t1 set b="Elephant house" where a=1;
44 update test.t1 set b="Beach house" where a=1;
45 select * from test.t1 order by a;
46 a b
47 1 Beach house
48 -- Now check they've applied on the Primary
49 select * from test.t1 order by a;
50 a b
51 1 Beach house
52 Conflict algorithm counter diff :
53 Exception table contents
54 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
55 server_id master_server_id master_epoch count a d
56 SELECT * FROM `t1$EX` ORDER BY a, d;
57 server_id master_server_id master_epoch count a d
58 --------------------------------------------
59 Test 2 : Normal Insert from Secondary Master
60 --------------------------------------------
61 -- Insert a new row on the Secondary
62 insert into test.t1 values (2, "Forrest");
63 -- Check it exists on the Primary
64 select * from test.t1 order by a;
65 a b
66 1 Beach house
67 2 Forrest
68 -- Update from the Secondary
69 update test.t1 set b="Reds" where a=2;
70 select * from test.t1 order by a;
71 a b
72 1 Beach house
73 2 Reds
74 delete from test.t1 where a=2;
75 select * from test.t1 order by a;
76 a b
77 1 Beach house
78 Conflict algorithm counter diff :
79 Exception table contents
80 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
81 server_id master_server_id master_epoch count a d
82 SELECT * FROM `t1$EX` ORDER BY a, d;
83 server_id master_server_id master_epoch count a d
84 -------------------------------
85 Test 3 : Insert-Insert conflict
86 -------------------------------
87 stop slave;
88 Warnings:
89 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
90 -- Insert a row on the Primary Master
91 insert into test.t1 values (2, "Loopy Lornas");
92 -- Insert a row on the secondary Master
93 insert into test.t1 values (2, "Cloisters");
94 -- Examine data on Primary Master (should be unaffected)
95 select * from test.t1 order by a;
96 a b
97 1 Beach house
98 2 Loopy Lornas
99 -- Examine conflict indicators on Primary Master
100 Conflict algorithm counter diff :
101 ndb_conflict_fn_epoch
102 1
103 Exception table contents
104 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
105 server_id master_server_id master_epoch count a d
106 1 3 # 1 # #
107 SELECT * FROM `t1$EX` ORDER BY a, d;
108 server_id master_server_id master_epoch count a d
109 1 3 # # 2 NULL
110 -- Examine data on isolated secondary Master (should be as-set)
111 select * from test.t1 order by a;
112 a b
113 1 Beach house
114 2 Cloisters
115 -- Restart secondary Masters slave
116 start slave;
117 Warnings:
118 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
119 -- Reexamine secondary Master's data (should be same as Primary Masters)
120 select * from test.t1 order by a;
121 a b
122 1 Beach house
123 2 Loopy Lornas
124 -------------------------------
125 Test 4 : Update-Update conflict
126 -------------------------------
127 -- Stop replication to secondary master
128 stop slave;
129 Warnings:
130 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
131 -- Update row on Primary Master
132 update test.t1 set b="Peters Yard" where a=2;
133 -- Show data on Primary Master
134 select * from test.t1 order by a;
135 a b
136 1 Beach house
137 2 Peters Yard
138 Conflict algorithm counter diff :
139 ndb_conflict_fn_epoch
140 1
141 Exception table contents
142 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
143 server_id master_server_id master_epoch count a d
144 1 3 # 1 # #
145 SELECT * FROM `t1$EX` ORDER BY a, d;
146 server_id master_server_id master_epoch count a d
147 1 3 # # 2 NULL
148 -- Update row on Secondary Master
149 update test.t1 set b="Toast" where a=2;
150 -- Examine data on Primary Master - should be unaffected
151 select * from test.t1 order by a;
152 a b
153 1 Beach house
154 2 Peters Yard
155 Conflict algorithm counter diff :
156 ndb_conflict_fn_epoch
157 2
158 Exception table contents
159 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
160 server_id master_server_id master_epoch count a d
161 1 3 # 1 # #
162 1 3 # 2 # #
163 SELECT * FROM `t1$EX` ORDER BY a, d;
164 server_id master_server_id master_epoch count a d
165 1 3 # # 2 NULL
166 1 3 # # 2 NULL
167 -- Check data on secondary - should be as set
168 select * from test.t1 order by a;
169 a b
170 1 Beach house
171 2 Toast
172 -- Now restart slave, will re-align row
173 start slave;
174 Warnings:
175 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
176 -- Check that Secondary is re-aligned
177 select * from test.t1 order by a;
178 a b
179 1 Beach house
180 2 Peters Yard
181 -------------------------------
182 Test 5 : Update-Delete conflict
183 -------------------------------
184 -- Stop Secondary slave
185 stop slave;
186 Warnings:
187 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
188 -- Update on Primary Master
189 update test.t1 set b="Pear tree" where a = 2;
190 -- Delete on Secondary Master
191 delete from test.t1 where a = 2;
192 -- Examine data on Primary Master, should be unaffected
193 select * from test.t1 order by a;
194 a b
195 1 Beach house
196 2 Pear tree
197 Conflict algorithm counter diff :
198 ndb_conflict_fn_epoch
199 3
200 Exception table contents
201 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
202 server_id master_server_id master_epoch count a d
203 1 3 # 1 # #
204 1 3 # 2 # #
205 1 3 # 3 # #
206 SELECT * FROM `t1$EX` ORDER BY a, d;
207 server_id master_server_id master_epoch count a d
208 1 3 # # 2 NULL
209 1 3 # # 2 NULL
210 1 3 # # 2 NULL
211 -- Examine data on Secondary Master before slave restart, still missing
212 select * from test.t1 order by a;
213 a b
214 1 Beach house
215 -- Restart Secondary Master slave
216 start slave;
217 Warnings:
218 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
219 -- Examine data on Secondary Master after slave restart, aligned with Master
220 select * from test.t1 order by a;
221 a b
222 1 Beach house
223 2 Pear tree
224 -------------------------------
225 Test 6 : Delete-Update conflict
226 -------------------------------
227 -- Stop Secondary slave
228 stop slave;
229 Warnings:
230 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
231 -- Delete on Primary Master
232 delete from test.t1 where a=2;
233 -- Update on Secondary Master
234 update test.t1 set b="Black pig" where a=2;
235 -- Examine data on Primary Master, should be unaffected (no row)
236 select * from test.t1 order by a;
237 a b
238 1 Beach house
239 Conflict algorithm counter diff :
240 ndb_conflict_fn_epoch
241 4
242 Exception table contents
243 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
244 server_id master_server_id master_epoch count a d
245 1 3 # 1 # #
246 1 3 # 2 # #
247 1 3 # 3 # #
248 1 3 # 4 # #
249 SELECT * FROM `t1$EX` ORDER BY a, d;
250 server_id master_server_id master_epoch count a d
251 1 3 # # 2 NULL
252 1 3 # # 2 NULL
253 1 3 # # 2 NULL
254 1 3 # # 2 NULL
255 -- Examine data on Secondary Master before slave restart, should be as inserted
256 select * from test.t1 order by a;
257 a b
258 1 Beach house
259 2 Black pig
260 -- Restart Secondary Master slave
261 start slave;
262 Warnings:
263 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
264 -- Examine data on Secondary Master after slave restart, aligned with Master (deleted)
265 select * from test.t1 order by a;
266 a b
267 1 Beach house
268 -------------------------------
269 Test 7 : Delete-Delete conflict
270 -------------------------------
271 -- Stop Secondary slave
272 stop slave;
273 Warnings:
274 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
275 -- Delete on Primary Master
276 delete from test.t1 where a=1;
277 -- Delete on Secondary Master
278 delete from test.t1 where a=1;
279 -- Examine data on Primary Master, no row
280 select * from test.t1 order by a;
281 a b
282 Conflict algorithm counter diff :
283 ndb_conflict_fn_epoch
284 5
285 ndb_epoch_delete_delete
286 1
287 Exception table contents
288 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
289 server_id master_server_id master_epoch count a d
290 1 3 # 1 # #
291 1 3 # 2 # #
292 1 3 # 3 # #
293 1 3 # 4 # #
294 1 3 # 5 # #
295 SELECT * FROM `t1$EX` ORDER BY a, d;
296 server_id master_server_id master_epoch count a d
297 1 3 # # 1 NULL
298 1 3 # # 2 NULL
299 1 3 # # 2 NULL
300 1 3 # # 2 NULL
301 1 3 # # 2 NULL
302 -- Examine data on Secondary Master before slave restart, no row
303 select * from test.t1 order by a;
304 a b
305 -- Restart Secondary Master slave
306 start slave;
307 Warnings:
308 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
309 -- Examine data on Secondary Master after slave restart, no row
310 select * from test.t1 order by a;
311 a b
312 ------------------------------------------------
313 Test 8 : Delete-Delete, Insert conflict exposure
314 ------------------------------------------------
315 -- Insert a row on Secondary Master
316 insert into test.t1 values (3, "Espy");
317 -- Check it's present on Primary Master
318 select * from test.t1 order by a;
319 a b
320 3 Espy
321 -- Stop replication in both directions
322 stop slave;
323 Warnings:
324 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
325 stop slave;
326 Warnings:
327 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
328 -- Delete row from both clusters
329 delete from test.t1 where a=3;
330 delete from test.t1 where a=3;
331 -- Follow up with Insert from Secondary master
332 insert into test.t1 values (3, "Dalriada");
333 -- Restart replication in both directions
334 start slave;
335 Warnings:
336 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
337 start slave;
338 Warnings:
339 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
340 -- Check data on both sites
341 -- diverged with NDB$EPOCH
342 -- consistent with NDB$EPOCH2
343 -- Secondary master :
344 select * from test.t1 order by a;
345 a b
346 -- Primary master :
347 select * from test.t1 order by a;
348 a b
349 3 Dalriada
350 --Remove extra row
351 delete from test.t1 where a=3;
352 -- Note that Delete-Delete conflict detected below
353 Conflict algorithm counter diff :
354 ndb_conflict_fn_epoch
355 6
356 ndb_epoch_delete_delete
357 2
358 Exception table contents
359 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
360 server_id master_server_id master_epoch count a d
361 1 3 # 1 # #
362 1 3 # 2 # #
363 1 3 # 3 # #
364 1 3 # 4 # #
365 1 3 # 5 # #
366 1 3 # 6 # #
367 SELECT * FROM `t1$EX` ORDER BY a, d;
368 server_id master_server_id master_epoch count a d
369 1 3 # # 1 NULL
370 1 3 # # 2 NULL
371 1 3 # # 2 NULL
372 1 3 # # 2 NULL
373 1 3 # # 2 NULL
374 1 3 # # 3 NULL
375 ------------------------------------------------
376 Test 9 : Insert, Insert-Update-Delete conflict
377 ------------------------------------------------
378 -- Stop replication on Secondary Master
379 stop slave;
380 Warnings:
381 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
382 -- Insert row on Primary Master
383 insert into test.t1 values (4, "Haymarket");
384 -- Insert row on Secondary Master
385 insert into test.t1 values (4, "Outhouse");
386 -- Update row on Secondary Master
387 update test.t1 set b="Mathers" where a = 4;
388 -- Delete row on Secondary Master
389 delete from test.t1 where a=4;
390 -- Examine data (none) on Secondary Master
391 select * from test.t1 order by a;
392 a b
393 -- Examine data on Primary Master, should be unaffected
394 select * from test.t1 order by a;
395 a b
396 4 Haymarket
397 Conflict algorithm counter diff :
398 ndb_conflict_fn_epoch
399 9
400 ndb_epoch_delete_delete
401 2
402 Exception table contents
403 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
404 server_id master_server_id master_epoch count a d
405 1 3 # 1 # #
406 1 3 # 2 # #
407 1 3 # 3 # #
408 1 3 # 4 # #
409 1 3 # 5 # #
410 1 3 # 6 # #
411 1 3 # 7 # #
412 1 3 # 8 # #
413 1 3 # 9 # #
414 SELECT * FROM `t1$EX` ORDER BY a, d;
415 server_id master_server_id master_epoch count a d
416 1 3 # # 1 NULL
417 1 3 # # 2 NULL
418 1 3 # # 2 NULL
419 1 3 # # 2 NULL
420 1 3 # # 2 NULL
421 1 3 # # 3 NULL
422 1 3 # # 4 NULL
423 1 3 # # 4 NULL
424 1 3 # # 4 NULL
425 -- Examine data on Secondary Master (none)
426 select * from test.t1 order by a;
427 a b
428 -- Restart Secondary Master's slave
429 start slave;
430 Warnings:
431 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
432 -- Check data on Secondary Master, should be same as Primary Master
433 select * from test.t1;
434 a b
435 4 Haymarket
436 ------------------------------------------------
437 Test 10 : Update, Delete-Insert-Update conflict
438 ------------------------------------------------
439 -- Stop replication on Secondary Master
440 stop slave;
441 Warnings:
442 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
443 -- Update row on Primary Master
444 update test.t1 set b="Blind poet" where a=4;
445 -- Delete row on Secondary Master
446 delete from test.t1 where a=4;
447 -- Insert row on Secondary Master
448 insert into test.t1 values (4, "Drouthy Neebors");
449 -- Update row on Secondary Master
450 update test.t1 set b="The Tankard" where a=4;
451 -- Check data on Primary Master, should be unaffected
452 select * from test.t1 order by a;
453 a b
454 4 Blind poet
455 Conflict algorithm counter diff :
456 ndb_conflict_fn_epoch
457 12
458 ndb_epoch_delete_delete
459 2
460 Exception table contents
461 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
462 server_id master_server_id master_epoch count a d
463 1 3 # 1 # #
464 1 3 # 2 # #
465 1 3 # 3 # #
466 1 3 # 4 # #
467 1 3 # 5 # #
468 1 3 # 6 # #
469 1 3 # 7 # #
470 1 3 # 8 # #
471 1 3 # 9 # #
472 1 3 # 10 # #
473 1 3 # 11 # #
474 1 3 # 12 # #
475 SELECT * FROM `t1$EX` ORDER BY a, d;
476 server_id master_server_id master_epoch count a d
477 1 3 # # 1 NULL
478 1 3 # # 2 NULL
479 1 3 # # 2 NULL
480 1 3 # # 2 NULL
481 1 3 # # 2 NULL
482 1 3 # # 3 NULL
483 1 3 # # 4 NULL
484 1 3 # # 4 NULL
485 1 3 # # 4 NULL
486 1 3 # # 4 NULL
487 1 3 # # 4 NULL
488 1 3 # # 4 NULL
489 -- Check data on Secondary Master, as set
490 select * from test.t1 order by a;
491 a b
492 4 The Tankard
493 -- Restart Secondary Master slave
494 start slave;
495 Warnings:
496 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
497 -- Check data on Secondary Master - should be as Primary
498 select * from test.t1 order by a;
499 a b
500 4 Blind poet
501 ------------------------------------------------------------------------
502 Test 11 : Test Secondary insert-update-delete accepted
503 ------------------------------------------------------------------------
504 Insert row on Secondary
505 insert into test.t1 values (5, "Minders");
506 Update row on Secondary
507 update test.t1 set b="Southsider" where a=5;
508 Delete row on Secondary
509 delete from test.t1 where a=5;
510 Check data on Primary, should be none. No new conflicts
511 select * from test.t1 order by a;
512 a b
513 4 Blind poet
514 Conflict algorithm counter diff :
515 ndb_conflict_fn_epoch
516 12
517 ndb_epoch_delete_delete
518 2
519 Exception table contents
520 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
521 server_id master_server_id master_epoch count a d
522 1 3 # 1 # #
523 1 3 # 2 # #
524 1 3 # 3 # #
525 1 3 # 4 # #
526 1 3 # 5 # #
527 1 3 # 6 # #
528 1 3 # 7 # #
529 1 3 # 8 # #
530 1 3 # 9 # #
531 1 3 # 10 # #
532 1 3 # 11 # #
533 1 3 # 12 # #
534 SELECT * FROM `t1$EX` ORDER BY a, d;
535 server_id master_server_id master_epoch count a d
536 1 3 # # 1 NULL
537 1 3 # # 2 NULL
538 1 3 # # 2 NULL
539 1 3 # # 2 NULL
540 1 3 # # 2 NULL
541 1 3 # # 3 NULL
542 1 3 # # 4 NULL
543 1 3 # # 4 NULL
544 1 3 # # 4 NULL
545 1 3 # # 4 NULL
546 1 3 # # 4 NULL
547 1 3 # # 4 NULL
548 Conflict algorithm counter diff :
549 ndb_conflict_fn_epoch
550 12
551 ndb_epoch_delete_delete
552 2
553 Exception table contents
554 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
555 server_id master_server_id master_epoch count a d
556 1 3 # 1 # #
557 1 3 # 2 # #
558 1 3 # 3 # #
559 1 3 # 4 # #
560 1 3 # 5 # #
561 1 3 # 6 # #
562 1 3 # 7 # #
563 1 3 # 8 # #
564 1 3 # 9 # #
565 1 3 # 10 # #
566 1 3 # 11 # #
567 1 3 # 12 # #
568 SELECT * FROM `t1$EX` ORDER BY a, d;
569 server_id master_server_id master_epoch count a d
570 1 3 # # 1 NULL
571 1 3 # # 2 NULL
572 1 3 # # 2 NULL
573 1 3 # # 2 NULL
574 1 3 # # 2 NULL
575 1 3 # # 3 NULL
576 1 3 # # 4 NULL
577 1 3 # # 4 NULL
578 1 3 # # 4 NULL
579 1 3 # # 4 NULL
580 1 3 # # 4 NULL
581 1 3 # # 4 NULL
582 drop table test.t1;
583 drop table test.t2;
584 drop table test.t1$EX;
585 Populate ndb_replication table as necessary
586 -- 1 extra gci bits
587 create table `test`.`t1$EX`
588 (server_id int unsigned,
589 master_server_id int unsigned,
590 master_epoch bigint unsigned,
591 count int unsigned,
592 a int not null,
593 d int,
594 primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
595 Create table
596 create table test.t1(a int primary key, b varchar(255)) engine = ndb;
597 Create other table
598 create table test.t2(a int primary key, b int) engine = ndb;
599 ----------------------------------
600 Test 1 : Basic two-way replication
601 ----------------------------------
602 insert into test.t1 values (1, "Metropole");
603 FLUSH LOGS;
604 -- Verify that Max rep epoch has been updated
605 -- Primary Cluster Max Rep Epoch now beyond the original update epoch
606 -- Now update data on slave
607 update test.t1 set b="Favorit" where a=1;
608 -- Now check data on Primary
609 select * from test.t1 order by a;
610 a b
611 1 Favorit
612 Conflict algorithm counter diff :
613 Exception table contents
614 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
615 server_id master_server_id master_epoch count a d
616 SELECT * FROM `t1$EX` ORDER BY a, d;
617 server_id master_server_id master_epoch count a d
618 -- Now perform multiple consecutive updates on the Secondary
619 update test.t1 set b="Elephant house" where a=1;
620 update test.t1 set b="Beach house" where a=1;
621 select * from test.t1 order by a;
622 a b
623 1 Beach house
624 -- Now check they've applied on the Primary
625 select * from test.t1 order by a;
626 a b
627 1 Beach house
628 Conflict algorithm counter diff :
629 Exception table contents
630 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
631 server_id master_server_id master_epoch count a d
632 SELECT * FROM `t1$EX` ORDER BY a, d;
633 server_id master_server_id master_epoch count a d
634 --------------------------------------------
635 Test 2 : Normal Insert from Secondary Master
636 --------------------------------------------
637 -- Insert a new row on the Secondary
638 insert into test.t1 values (2, "Forrest");
639 -- Check it exists on the Primary
640 select * from test.t1 order by a;
641 a b
642 1 Beach house
643 2 Forrest
644 -- Update from the Secondary
645 update test.t1 set b="Reds" where a=2;
646 select * from test.t1 order by a;
647 a b
648 1 Beach house
649 2 Reds
650 delete from test.t1 where a=2;
651 select * from test.t1 order by a;
652 a b
653 1 Beach house
654 Conflict algorithm counter diff :
655 Exception table contents
656 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
657 server_id master_server_id master_epoch count a d
658 SELECT * FROM `t1$EX` ORDER BY a, d;
659 server_id master_server_id master_epoch count a d
660 -------------------------------
661 Test 3 : Insert-Insert conflict
662 -------------------------------
663 stop slave;
664 Warnings:
665 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
666 -- Insert a row on the Primary Master
667 insert into test.t1 values (2, "Loopy Lornas");
668 -- Insert a row on the secondary Master
669 insert into test.t1 values (2, "Cloisters");
670 -- Examine data on Primary Master (should be unaffected)
671 select * from test.t1 order by a;
672 a b
673 1 Beach house
674 2 Loopy Lornas
675 -- Examine conflict indicators on Primary Master
676 Conflict algorithm counter diff :
677 ndb_conflict_fn_epoch
678 1
679 Exception table contents
680 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
681 server_id master_server_id master_epoch count a d
682 1 3 # 1 # #
683 SELECT * FROM `t1$EX` ORDER BY a, d;
684 server_id master_server_id master_epoch count a d
685 1 3 # # 2 NULL
686 -- Examine data on isolated secondary Master (should be as-set)
687 select * from test.t1 order by a;
688 a b
689 1 Beach house
690 2 Cloisters
691 -- Restart secondary Masters slave
692 start slave;
693 Warnings:
694 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
695 -- Reexamine secondary Master's data (should be same as Primary Masters)
696 select * from test.t1 order by a;
697 a b
698 1 Beach house
699 2 Loopy Lornas
700 -------------------------------
701 Test 4 : Update-Update conflict
702 -------------------------------
703 -- Stop replication to secondary master
704 stop slave;
705 Warnings:
706 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
707 -- Update row on Primary Master
708 update test.t1 set b="Peters Yard" where a=2;
709 -- Show data on Primary Master
710 select * from test.t1 order by a;
711 a b
712 1 Beach house
713 2 Peters Yard
714 Conflict algorithm counter diff :
715 ndb_conflict_fn_epoch
716 1
717 Exception table contents
718 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
719 server_id master_server_id master_epoch count a d
720 1 3 # 1 # #
721 SELECT * FROM `t1$EX` ORDER BY a, d;
722 server_id master_server_id master_epoch count a d
723 1 3 # # 2 NULL
724 -- Update row on Secondary Master
725 update test.t1 set b="Toast" where a=2;
726 -- Examine data on Primary Master - should be unaffected
727 select * from test.t1 order by a;
728 a b
729 1 Beach house
730 2 Peters Yard
731 Conflict algorithm counter diff :
732 ndb_conflict_fn_epoch
733 2
734 Exception table contents
735 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
736 server_id master_server_id master_epoch count a d
737 1 3 # 1 # #
738 1 3 # 2 # #
739 SELECT * FROM `t1$EX` ORDER BY a, d;
740 server_id master_server_id master_epoch count a d
741 1 3 # # 2 NULL
742 1 3 # # 2 NULL
743 -- Check data on secondary - should be as set
744 select * from test.t1 order by a;
745 a b
746 1 Beach house
747 2 Toast
748 -- Now restart slave, will re-align row
749 start slave;
750 Warnings:
751 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
752 -- Check that Secondary is re-aligned
753 select * from test.t1 order by a;
754 a b
755 1 Beach house
756 2 Peters Yard
757 -------------------------------
758 Test 5 : Update-Delete conflict
759 -------------------------------
760 -- Stop Secondary slave
761 stop slave;
762 Warnings:
763 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
764 -- Update on Primary Master
765 update test.t1 set b="Pear tree" where a = 2;
766 -- Delete on Secondary Master
767 delete from test.t1 where a = 2;
768 -- Examine data on Primary Master, should be unaffected
769 select * from test.t1 order by a;
770 a b
771 1 Beach house
772 2 Pear tree
773 Conflict algorithm counter diff :
774 ndb_conflict_fn_epoch
775 3
776 Exception table contents
777 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
778 server_id master_server_id master_epoch count a d
779 1 3 # 1 # #
780 1 3 # 2 # #
781 1 3 # 3 # #
782 SELECT * FROM `t1$EX` ORDER BY a, d;
783 server_id master_server_id master_epoch count a d
784 1 3 # # 2 NULL
785 1 3 # # 2 NULL
786 1 3 # # 2 NULL
787 -- Examine data on Secondary Master before slave restart, still missing
788 select * from test.t1 order by a;
789 a b
790 1 Beach house
791 -- Restart Secondary Master slave
792 start slave;
793 Warnings:
794 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
795 -- Examine data on Secondary Master after slave restart, aligned with Master
796 select * from test.t1 order by a;
797 a b
798 1 Beach house
799 2 Pear tree
800 -------------------------------
801 Test 6 : Delete-Update conflict
802 -------------------------------
803 -- Stop Secondary slave
804 stop slave;
805 Warnings:
806 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
807 -- Delete on Primary Master
808 delete from test.t1 where a=2;
809 -- Update on Secondary Master
810 update test.t1 set b="Black pig" where a=2;
811 -- Examine data on Primary Master, should be unaffected (no row)
812 select * from test.t1 order by a;
813 a b
814 1 Beach house
815 Conflict algorithm counter diff :
816 ndb_conflict_fn_epoch
817 4
818 Exception table contents
819 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
820 server_id master_server_id master_epoch count a d
821 1 3 # 1 # #
822 1 3 # 2 # #
823 1 3 # 3 # #
824 1 3 # 4 # #
825 SELECT * FROM `t1$EX` ORDER BY a, d;
826 server_id master_server_id master_epoch count a d
827 1 3 # # 2 NULL
828 1 3 # # 2 NULL
829 1 3 # # 2 NULL
830 1 3 # # 2 NULL
831 -- Examine data on Secondary Master before slave restart, should be as inserted
832 select * from test.t1 order by a;
833 a b
834 1 Beach house
835 2 Black pig
836 -- Restart Secondary Master slave
837 start slave;
838 Warnings:
839 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
840 -- Examine data on Secondary Master after slave restart, aligned with Master (deleted)
841 select * from test.t1 order by a;
842 a b
843 1 Beach house
844 -------------------------------
845 Test 7 : Delete-Delete conflict
846 -------------------------------
847 -- Stop Secondary slave
848 stop slave;
849 Warnings:
850 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
851 -- Delete on Primary Master
852 delete from test.t1 where a=1;
853 -- Delete on Secondary Master
854 delete from test.t1 where a=1;
855 -- Examine data on Primary Master, no row
856 select * from test.t1 order by a;
857 a b
858 Conflict algorithm counter diff :
859 ndb_conflict_fn_epoch
860 5
861 ndb_epoch_delete_delete
862 1
863 Exception table contents
864 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
865 server_id master_server_id master_epoch count a d
866 1 3 # 1 # #
867 1 3 # 2 # #
868 1 3 # 3 # #
869 1 3 # 4 # #
870 1 3 # 5 # #
871 SELECT * FROM `t1$EX` ORDER BY a, d;
872 server_id master_server_id master_epoch count a d
873 1 3 # # 1 NULL
874 1 3 # # 2 NULL
875 1 3 # # 2 NULL
876 1 3 # # 2 NULL
877 1 3 # # 2 NULL
878 -- Examine data on Secondary Master before slave restart, no row
879 select * from test.t1 order by a;
880 a b
881 -- Restart Secondary Master slave
882 start slave;
883 Warnings:
884 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
885 -- Examine data on Secondary Master after slave restart, no row
886 select * from test.t1 order by a;
887 a b
888 ------------------------------------------------
889 Test 8 : Delete-Delete, Insert conflict exposure
890 ------------------------------------------------
891 -- Insert a row on Secondary Master
892 insert into test.t1 values (3, "Espy");
893 -- Check it's present on Primary Master
894 select * from test.t1 order by a;
895 a b
896 3 Espy
897 -- Stop replication in both directions
898 stop slave;
899 Warnings:
900 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
901 stop slave;
902 Warnings:
903 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
904 -- Delete row from both clusters
905 delete from test.t1 where a=3;
906 delete from test.t1 where a=3;
907 -- Follow up with Insert from Secondary master
908 insert into test.t1 values (3, "Dalriada");
909 -- Restart replication in both directions
910 start slave;
911 Warnings:
912 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
913 start slave;
914 Warnings:
915 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
916 -- Check data on both sites
917 -- diverged with NDB$EPOCH
918 -- consistent with NDB$EPOCH2
919 -- Secondary master :
920 select * from test.t1 order by a;
921 a b
922 -- Primary master :
923 select * from test.t1 order by a;
924 a b
925 3 Dalriada
926 --Remove extra row
927 delete from test.t1 where a=3;
928 -- Note that Delete-Delete conflict detected below
929 Conflict algorithm counter diff :
930 ndb_conflict_fn_epoch
931 6
932 ndb_epoch_delete_delete
933 2
934 Exception table contents
935 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
936 server_id master_server_id master_epoch count a d
937 1 3 # 1 # #
938 1 3 # 2 # #
939 1 3 # 3 # #
940 1 3 # 4 # #
941 1 3 # 5 # #
942 1 3 # 6 # #
943 SELECT * FROM `t1$EX` ORDER BY a, d;
944 server_id master_server_id master_epoch count a d
945 1 3 # # 1 NULL
946 1 3 # # 2 NULL
947 1 3 # # 2 NULL
948 1 3 # # 2 NULL
949 1 3 # # 2 NULL
950 1 3 # # 3 NULL
951 ------------------------------------------------
952 Test 9 : Insert, Insert-Update-Delete conflict
953 ------------------------------------------------
954 -- Stop replication on Secondary Master
955 stop slave;
956 Warnings:
957 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
958 -- Insert row on Primary Master
959 insert into test.t1 values (4, "Haymarket");
960 -- Insert row on Secondary Master
961 insert into test.t1 values (4, "Outhouse");
962 -- Update row on Secondary Master
963 update test.t1 set b="Mathers" where a = 4;
964 -- Delete row on Secondary Master
965 delete from test.t1 where a=4;
966 -- Examine data (none) on Secondary Master
967 select * from test.t1 order by a;
968 a b
969 -- Examine data on Primary Master, should be unaffected
970 select * from test.t1 order by a;
971 a b
972 4 Haymarket
973 Conflict algorithm counter diff :
974 ndb_conflict_fn_epoch
975 9
976 ndb_epoch_delete_delete
977 2
978 Exception table contents
979 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
980 server_id master_server_id master_epoch count a d
981 1 3 # 1 # #
982 1 3 # 2 # #
983 1 3 # 3 # #
984 1 3 # 4 # #
985 1 3 # 5 # #
986 1 3 # 6 # #
987 1 3 # 7 # #
988 1 3 # 8 # #
989 1 3 # 9 # #
990 SELECT * FROM `t1$EX` ORDER BY a, d;
991 server_id master_server_id master_epoch count a d
992 1 3 # # 1 NULL
993 1 3 # # 2 NULL
994 1 3 # # 2 NULL
995 1 3 # # 2 NULL
996 1 3 # # 2 NULL
997 1 3 # # 3 NULL
998 1 3 # # 4 NULL
999 1 3 # # 4 NULL
1000 1 3 # # 4 NULL
1001 -- Examine data on Secondary Master (none)
1002 select * from test.t1 order by a;
1003 a b
1004 -- Restart Secondary Master's slave
1005 start slave;
1006 Warnings:
1007 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1008 -- Check data on Secondary Master, should be same as Primary Master
1009 select * from test.t1;
1010 a b
1011 4 Haymarket
1012 ------------------------------------------------
1013 Test 10 : Update, Delete-Insert-Update conflict
1014 ------------------------------------------------
1015 -- Stop replication on Secondary Master
1016 stop slave;
1017 Warnings:
1018 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1019 -- Update row on Primary Master
1020 update test.t1 set b="Blind poet" where a=4;
1021 -- Delete row on Secondary Master
1022 delete from test.t1 where a=4;
1023 -- Insert row on Secondary Master
1024 insert into test.t1 values (4, "Drouthy Neebors");
1025 -- Update row on Secondary Master
1026 update test.t1 set b="The Tankard" where a=4;
1027 -- Check data on Primary Master, should be unaffected
1028 select * from test.t1 order by a;
1029 a b
1030 4 Blind poet
1031 Conflict algorithm counter diff :
1032 ndb_conflict_fn_epoch
1033 12
1034 ndb_epoch_delete_delete
1035 2
1036 Exception table contents
1037 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1038 server_id master_server_id master_epoch count a d
1039 1 3 # 1 # #
1040 1 3 # 2 # #
1041 1 3 # 3 # #
1042 1 3 # 4 # #
1043 1 3 # 5 # #
1044 1 3 # 6 # #
1045 1 3 # 7 # #
1046 1 3 # 8 # #
1047 1 3 # 9 # #
1048 1 3 # 10 # #
1049 1 3 # 11 # #
1050 1 3 # 12 # #
1051 SELECT * FROM `t1$EX` ORDER BY a, d;
1052 server_id master_server_id master_epoch count a d
1053 1 3 # # 1 NULL
1054 1 3 # # 2 NULL
1055 1 3 # # 2 NULL
1056 1 3 # # 2 NULL
1057 1 3 # # 2 NULL
1058 1 3 # # 3 NULL
1059 1 3 # # 4 NULL
1060 1 3 # # 4 NULL
1061 1 3 # # 4 NULL
1062 1 3 # # 4 NULL
1063 1 3 # # 4 NULL
1064 1 3 # # 4 NULL
1065 -- Check data on Secondary Master, as set
1066 select * from test.t1 order by a;
1067 a b
1068 4 The Tankard
1069 -- Restart Secondary Master slave
1070 start slave;
1071 Warnings:
1072 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1073 -- Check data on Secondary Master - should be as Primary
1074 select * from test.t1 order by a;
1075 a b
1076 4 Blind poet
1077 ------------------------------------------------------------------------
1078 Test 11 : Test Secondary insert-update-delete accepted
1079 ------------------------------------------------------------------------
1080 Insert row on Secondary
1081 insert into test.t1 values (5, "Minders");
1082 Update row on Secondary
1083 update test.t1 set b="Southsider" where a=5;
1084 Delete row on Secondary
1085 delete from test.t1 where a=5;
1086 Check data on Primary, should be none. No new conflicts
1087 select * from test.t1 order by a;
1088 a b
1089 4 Blind poet
1090 Conflict algorithm counter diff :
1091 ndb_conflict_fn_epoch
1092 12
1093 ndb_epoch_delete_delete
1094 2
1095 Exception table contents
1096 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1097 server_id master_server_id master_epoch count a d
1098 1 3 # 1 # #
1099 1 3 # 2 # #
1100 1 3 # 3 # #
1101 1 3 # 4 # #
1102 1 3 # 5 # #
1103 1 3 # 6 # #
1104 1 3 # 7 # #
1105 1 3 # 8 # #
1106 1 3 # 9 # #
1107 1 3 # 10 # #
1108 1 3 # 11 # #
1109 1 3 # 12 # #
1110 SELECT * FROM `t1$EX` ORDER BY a, d;
1111 server_id master_server_id master_epoch count a d
1112 1 3 # # 1 NULL
1113 1 3 # # 2 NULL
1114 1 3 # # 2 NULL
1115 1 3 # # 2 NULL
1116 1 3 # # 2 NULL
1117 1 3 # # 3 NULL
1118 1 3 # # 4 NULL
1119 1 3 # # 4 NULL
1120 1 3 # # 4 NULL
1121 1 3 # # 4 NULL
1122 1 3 # # 4 NULL
1123 1 3 # # 4 NULL
1124 Conflict algorithm counter diff :
1125 ndb_conflict_fn_epoch
1126 12
1127 ndb_epoch_delete_delete
1128 2
1129 Exception table contents
1130 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1131 server_id master_server_id master_epoch count a d
1132 1 3 # 1 # #
1133 1 3 # 2 # #
1134 1 3 # 3 # #
1135 1 3 # 4 # #
1136 1 3 # 5 # #
1137 1 3 # 6 # #
1138 1 3 # 7 # #
1139 1 3 # 8 # #
1140 1 3 # 9 # #
1141 1 3 # 10 # #
1142 1 3 # 11 # #
1143 1 3 # 12 # #
1144 SELECT * FROM `t1$EX` ORDER BY a, d;
1145 server_id master_server_id master_epoch count a d
1146 1 3 # # 1 NULL
1147 1 3 # # 2 NULL
1148 1 3 # # 2 NULL
1149 1 3 # # 2 NULL
1150 1 3 # # 2 NULL
1151 1 3 # # 3 NULL
1152 1 3 # # 4 NULL
1153 1 3 # # 4 NULL
1154 1 3 # # 4 NULL
1155 1 3 # # 4 NULL
1156 1 3 # # 4 NULL
1157 1 3 # # 4 NULL
1158 drop table test.t1;
1159 drop table test.t2;
1160 drop table test.t1$EX;
1161 Populate ndb_replication table as necessary
1162 -- 31 extra gci bits
1163 create table `test`.`t1$EX`
1164 (server_id int unsigned,
1165 master_server_id int unsigned,
1166 master_epoch bigint unsigned,
1167 count int unsigned,
1168 a int not null,
1169 d int,
1170 primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
1171 Create table
1172 create table test.t1(a int primary key, b varchar(255)) engine = ndb;
1173 Create other table
1174 create table test.t2(a int primary key, b int) engine = ndb;
1175 ----------------------------------
1176 Test 1 : Basic two-way replication
1177 ----------------------------------
1178 insert into test.t1 values (1, "Metropole");
1179 FLUSH LOGS;
1180 -- Verify that Max rep epoch has been updated
1181 -- Primary Cluster Max Rep Epoch now beyond the original update epoch
1182 -- Now update data on slave
1183 update test.t1 set b="Favorit" where a=1;
1184 -- Now check data on Primary
1185 select * from test.t1 order by a;
1186 a b
1187 1 Favorit
1188 Conflict algorithm counter diff :
1189 Exception table contents
1190 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1191 server_id master_server_id master_epoch count a d
1192 SELECT * FROM `t1$EX` ORDER BY a, d;
1193 server_id master_server_id master_epoch count a d
1194 -- Now perform multiple consecutive updates on the Secondary
1195 update test.t1 set b="Elephant house" where a=1;
1196 update test.t1 set b="Beach house" where a=1;
1197 select * from test.t1 order by a;
1198 a b
1199 1 Beach house
1200 -- Now check they've applied on the Primary
1201 select * from test.t1 order by a;
1202 a b
1203 1 Beach house
1204 Conflict algorithm counter diff :
1205 Exception table contents
1206 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1207 server_id master_server_id master_epoch count a d
1208 SELECT * FROM `t1$EX` ORDER BY a, d;
1209 server_id master_server_id master_epoch count a d
1210 --------------------------------------------
1211 Test 2 : Normal Insert from Secondary Master
1212 --------------------------------------------
1213 -- Insert a new row on the Secondary
1214 insert into test.t1 values (2, "Forrest");
1215 -- Check it exists on the Primary
1216 select * from test.t1 order by a;
1217 a b
1218 1 Beach house
1219 2 Forrest
1220 -- Update from the Secondary
1221 update test.t1 set b="Reds" where a=2;
1222 select * from test.t1 order by a;
1223 a b
1224 1 Beach house
1225 2 Reds
1226 delete from test.t1 where a=2;
1227 select * from test.t1 order by a;
1228 a b
1229 1 Beach house
1230 Conflict algorithm counter diff :
1231 Exception table contents
1232 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1233 server_id master_server_id master_epoch count a d
1234 SELECT * FROM `t1$EX` ORDER BY a, d;
1235 server_id master_server_id master_epoch count a d
1236 -------------------------------
1237 Test 3 : Insert-Insert conflict
1238 -------------------------------
1239 stop slave;
1240 Warnings:
1241 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1242 -- Insert a row on the Primary Master
1243 insert into test.t1 values (2, "Loopy Lornas");
1244 -- Insert a row on the secondary Master
1245 insert into test.t1 values (2, "Cloisters");
1246 -- Examine data on Primary Master (should be unaffected)
1247 select * from test.t1 order by a;
1248 a b
1249 1 Beach house
1250 2 Loopy Lornas
1251 -- Examine conflict indicators on Primary Master
1252 Conflict algorithm counter diff :
1253 ndb_conflict_fn_epoch
1254 1
1255 Exception table contents
1256 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1257 server_id master_server_id master_epoch count a d
1258 1 3 # 1 # #
1259 SELECT * FROM `t1$EX` ORDER BY a, d;
1260 server_id master_server_id master_epoch count a d
1261 1 3 # # 2 NULL
1262 -- Examine data on isolated secondary Master (should be as-set)
1263 select * from test.t1 order by a;
1264 a b
1265 1 Beach house
1266 2 Cloisters
1267 -- Restart secondary Masters slave
1268 start slave;
1269 Warnings:
1270 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1271 -- Reexamine secondary Master's data (should be same as Primary Masters)
1272 select * from test.t1 order by a;
1273 a b
1274 1 Beach house
1275 2 Loopy Lornas
1276 -------------------------------
1277 Test 4 : Update-Update conflict
1278 -------------------------------
1279 -- Stop replication to secondary master
1280 stop slave;
1281 Warnings:
1282 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1283 -- Update row on Primary Master
1284 update test.t1 set b="Peters Yard" where a=2;
1285 -- Show data on Primary Master
1286 select * from test.t1 order by a;
1287 a b
1288 1 Beach house
1289 2 Peters Yard
1290 Conflict algorithm counter diff :
1291 ndb_conflict_fn_epoch
1292 1
1293 Exception table contents
1294 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1295 server_id master_server_id master_epoch count a d
1296 1 3 # 1 # #
1297 SELECT * FROM `t1$EX` ORDER BY a, d;
1298 server_id master_server_id master_epoch count a d
1299 1 3 # # 2 NULL
1300 -- Update row on Secondary Master
1301 update test.t1 set b="Toast" where a=2;
1302 -- Examine data on Primary Master - should be unaffected
1303 select * from test.t1 order by a;
1304 a b
1305 1 Beach house
1306 2 Peters Yard
1307 Conflict algorithm counter diff :
1308 ndb_conflict_fn_epoch
1309 2
1310 Exception table contents
1311 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1312 server_id master_server_id master_epoch count a d
1313 1 3 # 1 # #
1314 1 3 # 2 # #
1315 SELECT * FROM `t1$EX` ORDER BY a, d;
1316 server_id master_server_id master_epoch count a d
1317 1 3 # # 2 NULL
1318 1 3 # # 2 NULL
1319 -- Check data on secondary - should be as set
1320 select * from test.t1 order by a;
1321 a b
1322 1 Beach house
1323 2 Toast
1324 -- Now restart slave, will re-align row
1325 start slave;
1326 Warnings:
1327 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1328 -- Check that Secondary is re-aligned
1329 select * from test.t1 order by a;
1330 a b
1331 1 Beach house
1332 2 Peters Yard
1333 -------------------------------
1334 Test 5 : Update-Delete conflict
1335 -------------------------------
1336 -- Stop Secondary slave
1337 stop slave;
1338 Warnings:
1339 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1340 -- Update on Primary Master
1341 update test.t1 set b="Pear tree" where a = 2;
1342 -- Delete on Secondary Master
1343 delete from test.t1 where a = 2;
1344 -- Examine data on Primary Master, should be unaffected
1345 select * from test.t1 order by a;
1346 a b
1347 1 Beach house
1348 2 Pear tree
1349 Conflict algorithm counter diff :
1350 ndb_conflict_fn_epoch
1351 3
1352 Exception table contents
1353 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1354 server_id master_server_id master_epoch count a d
1355 1 3 # 1 # #
1356 1 3 # 2 # #
1357 1 3 # 3 # #
1358 SELECT * FROM `t1$EX` ORDER BY a, d;
1359 server_id master_server_id master_epoch count a d
1360 1 3 # # 2 NULL
1361 1 3 # # 2 NULL
1362 1 3 # # 2 NULL
1363 -- Examine data on Secondary Master before slave restart, still missing
1364 select * from test.t1 order by a;
1365 a b
1366 1 Beach house
1367 -- Restart Secondary Master slave
1368 start slave;
1369 Warnings:
1370 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1371 -- Examine data on Secondary Master after slave restart, aligned with Master
1372 select * from test.t1 order by a;
1373 a b
1374 1 Beach house
1375 2 Pear tree
1376 -------------------------------
1377 Test 6 : Delete-Update conflict
1378 -------------------------------
1379 -- Stop Secondary slave
1380 stop slave;
1381 Warnings:
1382 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1383 -- Delete on Primary Master
1384 delete from test.t1 where a=2;
1385 -- Update on Secondary Master
1386 update test.t1 set b="Black pig" where a=2;
1387 -- Examine data on Primary Master, should be unaffected (no row)
1388 select * from test.t1 order by a;
1389 a b
1390 1 Beach house
1391 Conflict algorithm counter diff :
1392 ndb_conflict_fn_epoch
1393 4
1394 Exception table contents
1395 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1396 server_id master_server_id master_epoch count a d
1397 1 3 # 1 # #
1398 1 3 # 2 # #
1399 1 3 # 3 # #
1400 1 3 # 4 # #
1401 SELECT * FROM `t1$EX` ORDER BY a, d;
1402 server_id master_server_id master_epoch count a d
1403 1 3 # # 2 NULL
1404 1 3 # # 2 NULL
1405 1 3 # # 2 NULL
1406 1 3 # # 2 NULL
1407 -- Examine data on Secondary Master before slave restart, should be as inserted
1408 select * from test.t1 order by a;
1409 a b
1410 1 Beach house
1411 2 Black pig
1412 -- Restart Secondary Master slave
1413 start slave;
1414 Warnings:
1415 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1416 -- Examine data on Secondary Master after slave restart, aligned with Master (deleted)
1417 select * from test.t1 order by a;
1418 a b
1419 1 Beach house
1420 -------------------------------
1421 Test 7 : Delete-Delete conflict
1422 -------------------------------
1423 -- Stop Secondary slave
1424 stop slave;
1425 Warnings:
1426 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1427 -- Delete on Primary Master
1428 delete from test.t1 where a=1;
1429 -- Delete on Secondary Master
1430 delete from test.t1 where a=1;
1431 -- Examine data on Primary Master, no row
1432 select * from test.t1 order by a;
1433 a b
1434 Conflict algorithm counter diff :
1435 ndb_conflict_fn_epoch
1436 5
1437 ndb_epoch_delete_delete
1438 1
1439 Exception table contents
1440 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1441 server_id master_server_id master_epoch count a d
1442 1 3 # 1 # #
1443 1 3 # 2 # #
1444 1 3 # 3 # #
1445 1 3 # 4 # #
1446 1 3 # 5 # #
1447 SELECT * FROM `t1$EX` ORDER BY a, d;
1448 server_id master_server_id master_epoch count a d
1449 1 3 # # 1 NULL
1450 1 3 # # 2 NULL
1451 1 3 # # 2 NULL
1452 1 3 # # 2 NULL
1453 1 3 # # 2 NULL
1454 -- Examine data on Secondary Master before slave restart, no row
1455 select * from test.t1 order by a;
1456 a b
1457 -- Restart Secondary Master slave
1458 start slave;
1459 Warnings:
1460 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1461 -- Examine data on Secondary Master after slave restart, no row
1462 select * from test.t1 order by a;
1463 a b
1464 ------------------------------------------------
1465 Test 8 : Delete-Delete, Insert conflict exposure
1466 ------------------------------------------------
1467 -- Insert a row on Secondary Master
1468 insert into test.t1 values (3, "Espy");
1469 -- Check it's present on Primary Master
1470 select * from test.t1 order by a;
1471 a b
1472 3 Espy
1473 -- Stop replication in both directions
1474 stop slave;
1475 Warnings:
1476 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1477 stop slave;
1478 Warnings:
1479 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1480 -- Delete row from both clusters
1481 delete from test.t1 where a=3;
1482 delete from test.t1 where a=3;
1483 -- Follow up with Insert from Secondary master
1484 insert into test.t1 values (3, "Dalriada");
1485 -- Restart replication in both directions
1486 start slave;
1487 Warnings:
1488 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1489 start slave;
1490 Warnings:
1491 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1492 -- Check data on both sites
1493 -- diverged with NDB$EPOCH
1494 -- consistent with NDB$EPOCH2
1495 -- Secondary master :
1496 select * from test.t1 order by a;
1497 a b
1498 -- Primary master :
1499 select * from test.t1 order by a;
1500 a b
1501 3 Dalriada
1502 --Remove extra row
1503 delete from test.t1 where a=3;
1504 -- Note that Delete-Delete conflict detected below
1505 Conflict algorithm counter diff :
1506 ndb_conflict_fn_epoch
1507 6
1508 ndb_epoch_delete_delete
1509 2
1510 Exception table contents
1511 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1512 server_id master_server_id master_epoch count a d
1513 1 3 # 1 # #
1514 1 3 # 2 # #
1515 1 3 # 3 # #
1516 1 3 # 4 # #
1517 1 3 # 5 # #
1518 1 3 # 6 # #
1519 SELECT * FROM `t1$EX` ORDER BY a, d;
1520 server_id master_server_id master_epoch count a d
1521 1 3 # # 1 NULL
1522 1 3 # # 2 NULL
1523 1 3 # # 2 NULL
1524 1 3 # # 2 NULL
1525 1 3 # # 2 NULL
1526 1 3 # # 3 NULL
1527 ------------------------------------------------
1528 Test 9 : Insert, Insert-Update-Delete conflict
1529 ------------------------------------------------
1530 -- Stop replication on Secondary Master
1531 stop slave;
1532 Warnings:
1533 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1534 -- Insert row on Primary Master
1535 insert into test.t1 values (4, "Haymarket");
1536 -- Insert row on Secondary Master
1537 insert into test.t1 values (4, "Outhouse");
1538 -- Update row on Secondary Master
1539 update test.t1 set b="Mathers" where a = 4;
1540 -- Delete row on Secondary Master
1541 delete from test.t1 where a=4;
1542 -- Examine data (none) on Secondary Master
1543 select * from test.t1 order by a;
1544 a b
1545 -- Examine data on Primary Master, should be unaffected
1546 select * from test.t1 order by a;
1547 a b
1548 4 Haymarket
1549 Conflict algorithm counter diff :
1550 ndb_conflict_fn_epoch
1551 9
1552 ndb_epoch_delete_delete
1553 2
1554 Exception table contents
1555 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1556 server_id master_server_id master_epoch count a d
1557 1 3 # 1 # #
1558 1 3 # 2 # #
1559 1 3 # 3 # #
1560 1 3 # 4 # #
1561 1 3 # 5 # #
1562 1 3 # 6 # #
1563 1 3 # 7 # #
1564 1 3 # 8 # #
1565 1 3 # 9 # #
1566 SELECT * FROM `t1$EX` ORDER BY a, d;
1567 server_id master_server_id master_epoch count a d
1568 1 3 # # 1 NULL
1569 1 3 # # 2 NULL
1570 1 3 # # 2 NULL
1571 1 3 # # 2 NULL
1572 1 3 # # 2 NULL
1573 1 3 # # 3 NULL
1574 1 3 # # 4 NULL
1575 1 3 # # 4 NULL
1576 1 3 # # 4 NULL
1577 -- Examine data on Secondary Master (none)
1578 select * from test.t1 order by a;
1579 a b
1580 -- Restart Secondary Master's slave
1581 start slave;
1582 Warnings:
1583 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1584 -- Check data on Secondary Master, should be same as Primary Master
1585 select * from test.t1;
1586 a b
1587 4 Haymarket
1588 ------------------------------------------------
1589 Test 10 : Update, Delete-Insert-Update conflict
1590 ------------------------------------------------
1591 -- Stop replication on Secondary Master
1592 stop slave;
1593 Warnings:
1594 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1595 -- Update row on Primary Master
1596 update test.t1 set b="Blind poet" where a=4;
1597 -- Delete row on Secondary Master
1598 delete from test.t1 where a=4;
1599 -- Insert row on Secondary Master
1600 insert into test.t1 values (4, "Drouthy Neebors");
1601 -- Update row on Secondary Master
1602 update test.t1 set b="The Tankard" where a=4;
1603 -- Check data on Primary Master, should be unaffected
1604 select * from test.t1 order by a;
1605 a b
1606 4 Blind poet
1607 Conflict algorithm counter diff :
1608 ndb_conflict_fn_epoch
1609 12
1610 ndb_epoch_delete_delete
1611 2
1612 Exception table contents
1613 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1614 server_id master_server_id master_epoch count a d
1615 1 3 # 1 # #
1616 1 3 # 2 # #
1617 1 3 # 3 # #
1618 1 3 # 4 # #
1619 1 3 # 5 # #
1620 1 3 # 6 # #
1621 1 3 # 7 # #
1622 1 3 # 8 # #
1623 1 3 # 9 # #
1624 1 3 # 10 # #
1625 1 3 # 11 # #
1626 1 3 # 12 # #
1627 SELECT * FROM `t1$EX` ORDER BY a, d;
1628 server_id master_server_id master_epoch count a d
1629 1 3 # # 1 NULL
1630 1 3 # # 2 NULL
1631 1 3 # # 2 NULL
1632 1 3 # # 2 NULL
1633 1 3 # # 2 NULL
1634 1 3 # # 3 NULL
1635 1 3 # # 4 NULL
1636 1 3 # # 4 NULL
1637 1 3 # # 4 NULL
1638 1 3 # # 4 NULL
1639 1 3 # # 4 NULL
1640 1 3 # # 4 NULL
1641 -- Check data on Secondary Master, as set
1642 select * from test.t1 order by a;
1643 a b
1644 4 The Tankard
1645 -- Restart Secondary Master slave
1646 start slave;
1647 Warnings:
1648 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1649 -- Check data on Secondary Master - should be as Primary
1650 select * from test.t1 order by a;
1651 a b
1652 4 Blind poet
1653 ------------------------------------------------------------------------
1654 Test 11 : Test Secondary insert-update-delete accepted
1655 ------------------------------------------------------------------------
1656 Insert row on Secondary
1657 insert into test.t1 values (5, "Minders");
1658 Update row on Secondary
1659 update test.t1 set b="Southsider" where a=5;
1660 Delete row on Secondary
1661 delete from test.t1 where a=5;
1662 Check data on Primary, should be none. No new conflicts
1663 select * from test.t1 order by a;
1664 a b
1665 4 Blind poet
1666 Conflict algorithm counter diff :
1667 ndb_conflict_fn_epoch
1668 12
1669 ndb_epoch_delete_delete
1670 2
1671 Exception table contents
1672 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1673 server_id master_server_id master_epoch count a d
1674 1 3 # 1 # #
1675 1 3 # 2 # #
1676 1 3 # 3 # #
1677 1 3 # 4 # #
1678 1 3 # 5 # #
1679 1 3 # 6 # #
1680 1 3 # 7 # #
1681 1 3 # 8 # #
1682 1 3 # 9 # #
1683 1 3 # 10 # #
1684 1 3 # 11 # #
1685 1 3 # 12 # #
1686 SELECT * FROM `t1$EX` ORDER BY a, d;
1687 server_id master_server_id master_epoch count a d
1688 1 3 # # 1 NULL
1689 1 3 # # 2 NULL
1690 1 3 # # 2 NULL
1691 1 3 # # 2 NULL
1692 1 3 # # 2 NULL
1693 1 3 # # 3 NULL
1694 1 3 # # 4 NULL
1695 1 3 # # 4 NULL
1696 1 3 # # 4 NULL
1697 1 3 # # 4 NULL
1698 1 3 # # 4 NULL
1699 1 3 # # 4 NULL
1700 Conflict algorithm counter diff :
1701 ndb_conflict_fn_epoch
1702 12
1703 ndb_epoch_delete_delete
1704 2
1705 Exception table contents
1706 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1707 server_id master_server_id master_epoch count a d
1708 1 3 # 1 # #
1709 1 3 # 2 # #
1710 1 3 # 3 # #
1711 1 3 # 4 # #
1712 1 3 # 5 # #
1713 1 3 # 6 # #
1714 1 3 # 7 # #
1715 1 3 # 8 # #
1716 1 3 # 9 # #
1717 1 3 # 10 # #
1718 1 3 # 11 # #
1719 1 3 # 12 # #
1720 SELECT * FROM `t1$EX` ORDER BY a, d;
1721 server_id master_server_id master_epoch count a d
1722 1 3 # # 1 NULL
1723 1 3 # # 2 NULL
1724 1 3 # # 2 NULL
1725 1 3 # # 2 NULL
1726 1 3 # # 2 NULL
1727 1 3 # # 3 NULL
1728 1 3 # # 4 NULL
1729 1 3 # # 4 NULL
1730 1 3 # # 4 NULL
1731 1 3 # # 4 NULL
1732 1 3 # # 4 NULL
1733 1 3 # # 4 NULL
1734 drop table test.t1;
1735 drop table test.t2;
1736 drop table test.t1$EX;
1737 Populate ndb_replication table as necessary
1738 -- Default extra Gci bits
1739 create table `test`.`t1$EX`
1740 (server_id int unsigned,
1741 master_server_id int unsigned,
1742 master_epoch bigint unsigned,
1743 count int unsigned,
1744 a int not null,
1745 d int,
1746 primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
1747 Create table
1748 create table test.t1(a int primary key, b varchar(255)) engine = ndb;
1749 Create other table
1750 create table test.t2(a int primary key, b int) engine = ndb;
1751 ----------------------------------
1752 Test 1 : Basic two-way replication
1753 ----------------------------------
1754 insert into test.t1 values (1, "Metropole");
1755 FLUSH LOGS;
1756 -- Verify that Max rep epoch has been updated
1757 -- Primary Cluster Max Rep Epoch now beyond the original update epoch
1758 -- Now update data on slave
1759 update test.t1 set b="Favorit" where a=1;
1760 -- Now check data on Primary
1761 select * from test.t1 order by a;
1762 a b
1763 1 Favorit
1764 Conflict algorithm counter diff :
1765 Exception table contents
1766 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1767 server_id master_server_id master_epoch count a d
1768 SELECT * FROM `t1$EX` ORDER BY a, d;
1769 server_id master_server_id master_epoch count a d
1770 -- Now perform multiple consecutive updates on the Secondary
1771 update test.t1 set b="Elephant house" where a=1;
1772 update test.t1 set b="Beach house" where a=1;
1773 select * from test.t1 order by a;
1774 a b
1775 1 Beach house
1776 -- Now check they've applied on the Primary
1777 select * from test.t1 order by a;
1778 a b
1779 1 Beach house
1780 Conflict algorithm counter diff :
1781 Exception table contents
1782 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1783 server_id master_server_id master_epoch count a d
1784 SELECT * FROM `t1$EX` ORDER BY a, d;
1785 server_id master_server_id master_epoch count a d
1786 --------------------------------------------
1787 Test 2 : Normal Insert from Secondary Master
1788 --------------------------------------------
1789 -- Insert a new row on the Secondary
1790 insert into test.t1 values (2, "Forrest");
1791 -- Check it exists on the Primary
1792 select * from test.t1 order by a;
1793 a b
1794 1 Beach house
1795 2 Forrest
1796 -- Update from the Secondary
1797 update test.t1 set b="Reds" where a=2;
1798 select * from test.t1 order by a;
1799 a b
1800 1 Beach house
1801 2 Reds
1802 delete from test.t1 where a=2;
1803 select * from test.t1 order by a;
1804 a b
1805 1 Beach house
1806 Conflict algorithm counter diff :
1807 Exception table contents
1808 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1809 server_id master_server_id master_epoch count a d
1810 SELECT * FROM `t1$EX` ORDER BY a, d;
1811 server_id master_server_id master_epoch count a d
1812 -------------------------------
1813 Test 3 : Insert-Insert conflict
1814 -------------------------------
1815 stop slave;
1816 Warnings:
1817 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1818 -- Insert a row on the Primary Master
1819 insert into test.t1 values (2, "Loopy Lornas");
1820 -- Insert a row on the secondary Master
1821 insert into test.t1 values (2, "Cloisters");
1822 -- Examine data on Primary Master (should be unaffected)
1823 select * from test.t1 order by a;
1824 a b
1825 1 Beach house
1826 2 Loopy Lornas
1827 -- Examine conflict indicators on Primary Master
1828 Conflict algorithm counter diff :
1829 ndb_conflict_fn_epoch
1830 1
1831 Exception table contents
1832 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1833 server_id master_server_id master_epoch count a d
1834 1 3 # 1 # #
1835 SELECT * FROM `t1$EX` ORDER BY a, d;
1836 server_id master_server_id master_epoch count a d
1837 1 3 # # 2 NULL
1838 -- Examine data on isolated secondary Master (should be as-set)
1839 select * from test.t1 order by a;
1840 a b
1841 1 Beach house
1842 2 Cloisters
1843 -- Restart secondary Masters slave
1844 start slave;
1845 Warnings:
1846 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1847 -- Reexamine secondary Master's data (should be same as Primary Masters)
1848 select * from test.t1 order by a;
1849 a b
1850 1 Beach house
1851 2 Loopy Lornas
1852 -------------------------------
1853 Test 4 : Update-Update conflict
1854 -------------------------------
1855 -- Stop replication to secondary master
1856 stop slave;
1857 Warnings:
1858 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1859 -- Update row on Primary Master
1860 update test.t1 set b="Peters Yard" where a=2;
1861 -- Show data on Primary Master
1862 select * from test.t1 order by a;
1863 a b
1864 1 Beach house
1865 2 Peters Yard
1866 Conflict algorithm counter diff :
1867 ndb_conflict_fn_epoch
1868 1
1869 Exception table contents
1870 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1871 server_id master_server_id master_epoch count a d
1872 1 3 # 1 # #
1873 SELECT * FROM `t1$EX` ORDER BY a, d;
1874 server_id master_server_id master_epoch count a d
1875 1 3 # # 2 NULL
1876 -- Update row on Secondary Master
1877 update test.t1 set b="Toast" where a=2;
1878 -- Examine data on Primary Master - should be unaffected
1879 select * from test.t1 order by a;
1880 a b
1881 1 Beach house
1882 2 Peters Yard
1883 Conflict algorithm counter diff :
1884 ndb_conflict_fn_epoch
1885 2
1886 Exception table contents
1887 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1888 server_id master_server_id master_epoch count a d
1889 1 3 # 1 # #
1890 1 3 # 2 # #
1891 SELECT * FROM `t1$EX` ORDER BY a, d;
1892 server_id master_server_id master_epoch count a d
1893 1 3 # # 2 NULL
1894 1 3 # # 2 NULL
1895 -- Check data on secondary - should be as set
1896 select * from test.t1 order by a;
1897 a b
1898 1 Beach house
1899 2 Toast
1900 -- Now restart slave, will re-align row
1901 start slave;
1902 Warnings:
1903 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1904 -- Check that Secondary is re-aligned
1905 select * from test.t1 order by a;
1906 a b
1907 1 Beach house
1908 2 Peters Yard
1909 -------------------------------
1910 Test 5 : Update-Delete conflict
1911 -------------------------------
1912 -- Stop Secondary slave
1913 stop slave;
1914 Warnings:
1915 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1916 -- Update on Primary Master
1917 update test.t1 set b="Pear tree" where a = 2;
1918 -- Delete on Secondary Master
1919 delete from test.t1 where a = 2;
1920 -- Examine data on Primary Master, should be unaffected
1921 select * from test.t1 order by a;
1922 a b
1923 1 Beach house
1924 2 Pear tree
1925 Conflict algorithm counter diff :
1926 ndb_conflict_fn_epoch
1927 3
1928 Exception table contents
1929 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1930 server_id master_server_id master_epoch count a d
1931 1 3 # 1 # #
1932 1 3 # 2 # #
1933 1 3 # 3 # #
1934 SELECT * FROM `t1$EX` ORDER BY a, d;
1935 server_id master_server_id master_epoch count a d
1936 1 3 # # 2 NULL
1937 1 3 # # 2 NULL
1938 1 3 # # 2 NULL
1939 -- Examine data on Secondary Master before slave restart, still missing
1940 select * from test.t1 order by a;
1941 a b
1942 1 Beach house
1943 -- Restart Secondary Master slave
1944 start slave;
1945 Warnings:
1946 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1947 -- Examine data on Secondary Master after slave restart, aligned with Master
1948 select * from test.t1 order by a;
1949 a b
1950 1 Beach house
1951 2 Pear tree
1952 -------------------------------
1953 Test 6 : Delete-Update conflict
1954 -------------------------------
1955 -- Stop Secondary slave
1956 stop slave;
1957 Warnings:
1958 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
1959 -- Delete on Primary Master
1960 delete from test.t1 where a=2;
1961 -- Update on Secondary Master
1962 update test.t1 set b="Black pig" where a=2;
1963 -- Examine data on Primary Master, should be unaffected (no row)
1964 select * from test.t1 order by a;
1965 a b
1966 1 Beach house
1967 Conflict algorithm counter diff :
1968 ndb_conflict_fn_epoch
1969 4
1970 Exception table contents
1971 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
1972 server_id master_server_id master_epoch count a d
1973 1 3 # 1 # #
1974 1 3 # 2 # #
1975 1 3 # 3 # #
1976 1 3 # 4 # #
1977 SELECT * FROM `t1$EX` ORDER BY a, d;
1978 server_id master_server_id master_epoch count a d
1979 1 3 # # 2 NULL
1980 1 3 # # 2 NULL
1981 1 3 # # 2 NULL
1982 1 3 # # 2 NULL
1983 -- Examine data on Secondary Master before slave restart, should be as inserted
1984 select * from test.t1 order by a;
1985 a b
1986 1 Beach house
1987 2 Black pig
1988 -- Restart Secondary Master slave
1989 start slave;
1990 Warnings:
1991 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
1992 -- Examine data on Secondary Master after slave restart, aligned with Master (deleted)
1993 select * from test.t1 order by a;
1994 a b
1995 1 Beach house
1996 -------------------------------
1997 Test 7 : Delete-Delete conflict
1998 -------------------------------
1999 -- Stop Secondary slave
2000 stop slave;
2001 Warnings:
2002 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
2003 -- Delete on Primary Master
2004 delete from test.t1 where a=1;
2005 -- Delete on Secondary Master
2006 delete from test.t1 where a=1;
2007 -- Examine data on Primary Master, no row
2008 select * from test.t1 order by a;
2009 a b
2010 Conflict algorithm counter diff :
2011 ndb_conflict_fn_epoch
2012 5
2013 ndb_epoch_delete_delete
2014 1
2015 Exception table contents
2016 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
2017 server_id master_server_id master_epoch count a d
2018 1 3 # 1 # #
2019 1 3 # 2 # #
2020 1 3 # 3 # #
2021 1 3 # 4 # #
2022 1 3 # 5 # #
2023 SELECT * FROM `t1$EX` ORDER BY a, d;
2024 server_id master_server_id master_epoch count a d
2025 1 3 # # 1 NULL
2026 1 3 # # 2 NULL
2027 1 3 # # 2 NULL
2028 1 3 # # 2 NULL
2029 1 3 # # 2 NULL
2030 -- Examine data on Secondary Master before slave restart, no row
2031 select * from test.t1 order by a;
2032 a b
2033 -- Restart Secondary Master slave
2034 start slave;
2035 Warnings:
2036 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
2037 -- Examine data on Secondary Master after slave restart, no row
2038 select * from test.t1 order by a;
2039 a b
2040 ------------------------------------------------
2041 Test 8 : Delete-Delete, Insert conflict exposure
2042 ------------------------------------------------
2043 -- Insert a row on Secondary Master
2044 insert into test.t1 values (3, "Espy");
2045 -- Check it's present on Primary Master
2046 select * from test.t1 order by a;
2047 a b
2048 3 Espy
2049 -- Stop replication in both directions
2050 stop slave;
2051 Warnings:
2052 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
2053 stop slave;
2054 Warnings:
2055 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
2056 -- Delete row from both clusters
2057 delete from test.t1 where a=3;
2058 delete from test.t1 where a=3;
2059 -- Follow up with Insert from Secondary master
2060 insert into test.t1 values (3, "Dalriada");
2061 -- Restart replication in both directions
2062 start slave;
2063 Warnings:
2064 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
2065 start slave;
2066 Warnings:
2067 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
2068 -- Check data on both sites
2069 -- diverged with NDB$EPOCH
2070 -- consistent with NDB$EPOCH2
2071 -- Secondary master :
2072 select * from test.t1 order by a;
2073 a b
2074 -- Primary master :
2075 select * from test.t1 order by a;
2076 a b
2077 3 Dalriada
2078 --Remove extra row
2079 delete from test.t1 where a=3;
2080 -- Note that Delete-Delete conflict detected below
2081 Conflict algorithm counter diff :
2082 ndb_conflict_fn_epoch
2083 6
2084 ndb_epoch_delete_delete
2085 2
2086 Exception table contents
2087 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
2088 server_id master_server_id master_epoch count a d
2089 1 3 # 1 # #
2090 1 3 # 2 # #
2091 1 3 # 3 # #
2092 1 3 # 4 # #
2093 1 3 # 5 # #
2094 1 3 # 6 # #
2095 SELECT * FROM `t1$EX` ORDER BY a, d;
2096 server_id master_server_id master_epoch count a d
2097 1 3 # # 1 NULL
2098 1 3 # # 2 NULL
2099 1 3 # # 2 NULL
2100 1 3 # # 2 NULL
2101 1 3 # # 2 NULL
2102 1 3 # # 3 NULL
2103 ------------------------------------------------
2104 Test 9 : Insert, Insert-Update-Delete conflict
2105 ------------------------------------------------
2106 -- Stop replication on Secondary Master
2107 stop slave;
2108 Warnings:
2109 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
2110 -- Insert row on Primary Master
2111 insert into test.t1 values (4, "Haymarket");
2112 -- Insert row on Secondary Master
2113 insert into test.t1 values (4, "Outhouse");
2114 -- Update row on Secondary Master
2115 update test.t1 set b="Mathers" where a = 4;
2116 -- Delete row on Secondary Master
2117 delete from test.t1 where a=4;
2118 -- Examine data (none) on Secondary Master
2119 select * from test.t1 order by a;
2120 a b
2121 -- Examine data on Primary Master, should be unaffected
2122 select * from test.t1 order by a;
2123 a b
2124 4 Haymarket
2125 Conflict algorithm counter diff :
2126 ndb_conflict_fn_epoch
2127 9
2128 ndb_epoch_delete_delete
2129 2
2130 Exception table contents
2131 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
2132 server_id master_server_id master_epoch count a d
2133 1 3 # 1 # #
2134 1 3 # 2 # #
2135 1 3 # 3 # #
2136 1 3 # 4 # #
2137 1 3 # 5 # #
2138 1 3 # 6 # #
2139 1 3 # 7 # #
2140 1 3 # 8 # #
2141 1 3 # 9 # #
2142 SELECT * FROM `t1$EX` ORDER BY a, d;
2143 server_id master_server_id master_epoch count a d
2144 1 3 # # 1 NULL
2145 1 3 # # 2 NULL
2146 1 3 # # 2 NULL
2147 1 3 # # 2 NULL
2148 1 3 # # 2 NULL
2149 1 3 # # 3 NULL
2150 1 3 # # 4 NULL
2151 1 3 # # 4 NULL
2152 1 3 # # 4 NULL
2153 -- Examine data on Secondary Master (none)
2154 select * from test.t1 order by a;
2155 a b
2156 -- Restart Secondary Master's slave
2157 start slave;
2158 Warnings:
2159 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
2160 -- Check data on Secondary Master, should be same as Primary Master
2161 select * from test.t1;
2162 a b
2163 4 Haymarket
2164 ------------------------------------------------
2165 Test 10 : Update, Delete-Insert-Update conflict
2166 ------------------------------------------------
2167 -- Stop replication on Secondary Master
2168 stop slave;
2169 Warnings:
2170 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
2171 -- Update row on Primary Master
2172 update test.t1 set b="Blind poet" where a=4;
2173 -- Delete row on Secondary Master
2174 delete from test.t1 where a=4;
2175 -- Insert row on Secondary Master
2176 insert into test.t1 values (4, "Drouthy Neebors");
2177 -- Update row on Secondary Master
2178 update test.t1 set b="The Tankard" where a=4;
2179 -- Check data on Primary Master, should be unaffected
2180 select * from test.t1 order by a;
2181 a b
2182 4 Blind poet
2183 Conflict algorithm counter diff :
2184 ndb_conflict_fn_epoch
2185 12
2186 ndb_epoch_delete_delete
2187 2
2188 Exception table contents
2189 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
2190 server_id master_server_id master_epoch count a d
2191 1 3 # 1 # #
2192 1 3 # 2 # #
2193 1 3 # 3 # #
2194 1 3 # 4 # #
2195 1 3 # 5 # #
2196 1 3 # 6 # #
2197 1 3 # 7 # #
2198 1 3 # 8 # #
2199 1 3 # 9 # #
2200 1 3 # 10 # #
2201 1 3 # 11 # #
2202 1 3 # 12 # #
2203 SELECT * FROM `t1$EX` ORDER BY a, d;
2204 server_id master_server_id master_epoch count a d
2205 1 3 # # 1 NULL
2206 1 3 # # 2 NULL
2207 1 3 # # 2 NULL
2208 1 3 # # 2 NULL
2209 1 3 # # 2 NULL
2210 1 3 # # 3 NULL
2211 1 3 # # 4 NULL
2212 1 3 # # 4 NULL
2213 1 3 # # 4 NULL
2214 1 3 # # 4 NULL
2215 1 3 # # 4 NULL
2216 1 3 # # 4 NULL
2217 -- Check data on Secondary Master, as set
2218 select * from test.t1 order by a;
2219 a b
2220 4 The Tankard
2221 -- Restart Secondary Master slave
2222 start slave;
2223 Warnings:
2224 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
2225 -- Check data on Secondary Master - should be as Primary
2226 select * from test.t1 order by a;
2227 a b
2228 4 Blind poet
2229 ------------------------------------------------------------------------
2230 Test 11 : Test Secondary insert-update-delete accepted
2231 ------------------------------------------------------------------------
2232 Insert row on Secondary
2233 insert into test.t1 values (5, "Minders");
2234 Update row on Secondary
2235 update test.t1 set b="Southsider" where a=5;
2236 Delete row on Secondary
2237 delete from test.t1 where a=5;
2238 Check data on Primary, should be none. No new conflicts
2239 select * from test.t1 order by a;
2240 a b
2241 4 Blind poet
2242 Conflict algorithm counter diff :
2243 ndb_conflict_fn_epoch
2244 12
2245 ndb_epoch_delete_delete
2246 2
2247 Exception table contents
2248 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
2249 server_id master_server_id master_epoch count a d
2250 1 3 # 1 # #
2251 1 3 # 2 # #
2252 1 3 # 3 # #
2253 1 3 # 4 # #
2254 1 3 # 5 # #
2255 1 3 # 6 # #
2256 1 3 # 7 # #
2257 1 3 # 8 # #
2258 1 3 # 9 # #
2259 1 3 # 10 # #
2260 1 3 # 11 # #
2261 1 3 # 12 # #
2262 SELECT * FROM `t1$EX` ORDER BY a, d;
2263 server_id master_server_id master_epoch count a d
2264 1 3 # # 1 NULL
2265 1 3 # # 2 NULL
2266 1 3 # # 2 NULL
2267 1 3 # # 2 NULL
2268 1 3 # # 2 NULL
2269 1 3 # # 3 NULL
2270 1 3 # # 4 NULL
2271 1 3 # # 4 NULL
2272 1 3 # # 4 NULL
2273 1 3 # # 4 NULL
2274 1 3 # # 4 NULL
2275 1 3 # # 4 NULL
2276 Conflict algorithm counter diff :
2277 ndb_conflict_fn_epoch
2278 12
2279 ndb_epoch_delete_delete
2280 2
2281 Exception table contents
2282 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
2283 server_id master_server_id master_epoch count a d
2284 1 3 # 1 # #
2285 1 3 # 2 # #
2286 1 3 # 3 # #
2287 1 3 # 4 # #
2288 1 3 # 5 # #
2289 1 3 # 6 # #
2290 1 3 # 7 # #
2291 1 3 # 8 # #
2292 1 3 # 9 # #
2293 1 3 # 10 # #
2294 1 3 # 11 # #
2295 1 3 # 12 # #
2296 SELECT * FROM `t1$EX` ORDER BY a, d;
2297 server_id master_server_id master_epoch count a d
2298 1 3 # # 1 NULL
2299 1 3 # # 2 NULL
2300 1 3 # # 2 NULL
2301 1 3 # # 2 NULL
2302 1 3 # # 2 NULL
2303 1 3 # # 3 NULL
2304 1 3 # # 4 NULL
2305 1 3 # # 4 NULL
2306 1 3 # # 4 NULL
2307 1 3 # # 4 NULL
2308 1 3 # # 4 NULL
2309 1 3 # # 4 NULL
2310 drop table test.t1;
2311 drop table test.t2;
2312 drop table test.t1$EX;
2313 Now test batched conflict detection/handling
2314 create table test.t1 (
2315 a int primary key,
2316 b int,
2317 c varchar(2000)) engine=ndb;
2318 -- Stop replication from Primary -> Secondary
2319 stop slave;
2320 Warnings:
2321 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
2322 -- Insert a row on Primary
2323 insert into test.t1 values (1,1,repeat('B', 2000));
2324 -- Generate a large batch of inserts with early + late conflicts
2325 create procedure test.doit (`rows` int)
2326 begin
2327 set @x = 0;
2328 START TRANSACTION;
2329 repeat
2330 insert into test.t1 values (@x, @x, repeat('B', 2000));
2331 set @x = @x + 1;
2332 until @x = `rows`
2333 end repeat;
2334 COMMIT;
2335 START TRANSACTION;
2336 update test.t1 set b=999, c=repeat('E',2000) where a=1;
2337 COMMIT;
2338 START TRANSACTION;
2339 delete from test.t1 where a=1;
2340 COMMIT;
2341 START TRANSACTION;
2342 insert into test.t1 values (1,1,'A');
2343 COMMIT;
2344 end%
2345 call test.doit(100);
2346 drop procedure test.doit;
2347 -- Look at Primary status, expect 4 conflicts
2348 Conflict algorithm counter diff :
2349 ndb_conflict_fn_epoch
2350 4
2351 Exception table contents
2352 SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
2353 SELECT * FROM `t1$EX` ORDER BY a, d;
2354 start slave;
2355 Warnings:
2356 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
2357 -- Look at Seconday row
2358 select a,b,sha1(c) from test.t1 where a=1;
2359 a b sha1(c)
2360 1 1 6d41e1d402596dff36396d1f0f288d17a4b9800a
2361 -- Check it's the same on the Secondary
2362 select a,b,sha1(c) from test.t1 where a=1;
2363 a b sha1(c)
2364 1 1 6d41e1d402596dff36396d1f0f288d17a4b9800a
2365 Test batching of DELETE vs DELETE with following INSERT
2366 delete from test.t1;
2367 insert into test.t1 values (1, 1, "Ma Brows");
2368 -- Stop Slave in both directions
2369 stop slave;
2370 Warnings:
2371 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
2372 stop slave;
2373 Warnings:
2374 Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
2375 -- Delete row on Primary Cluster
2376 delete from test.t1 where a=1;
2377 -- Delete row on Secondary Cluster, followed by Insert in later 'batch'
2378 create procedure test.doit (`rows` int)
2379 begin
2380 set @x = 2;
2381 START TRANSACTION;
2382 delete from test.t1 where a=1;
2383 repeat
2384 insert into test.t1 values (@x, @x, repeat('B', 2000));
2385 set @x = @x + 1;
2386 until @x = (`rows` + 2)
2387 end repeat;
2388 COMMIT;
2389 START TRANSACTION;
2390 insert into test.t1 values (1, 1, 'Malleny arms');
2391 COMMIT;
2392 end%
2393 call test.doit(200);
2394 -- Restart slave on Primary Cluster
2395 start replica;
2396 -- Show data on Primary Cluster (should have row inserted on Secondary)
2397 select * from test.t1 where a=1;
2398 a b c
2399 1 1 Malleny arms
2400 -- Show data on Secondary Cluster (should have row inserted on Secondary)
2401 select * from test.t1 where a=1;
2402 a b c
2403 1 1 Malleny arms
2404 --Restart slave on Secondary Cluster
2405 start slave;
2406 Warnings:
2407 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
2408 -- Show data on Clusters after slaves restarted+synced
2409 For NDB$EPOCH, the data will be missing
2410 as expected with delete vs delete conflict
2411 followed closely by Insert
2412 For NDB$EPOCH2, the data will be present on both
2413 clusters.
2414 PRIMARY
2415 select * from test.t1 where a=1;
2416 a b c
2417 1 1 Malleny arms
2418 SECONDARY
2419 select * from test.t1 where a=1;
2420 a b c
2421 -- Force wait for master to be in-sync with slave
2422 To avoid race between DML and table drop
2423 flush logs;
2424 drop procedure test.doit;
2425 drop table test.t1;
2426 delete from mysql.ndb_replication;
2427 insert into mysql.ndb_replication values
2428 ("test", "t3", 0, 7, "NDB$EPOCH(32)"),
2429 ("test", "t4", 0, 7, "NDB$EPOCH(-1)");
2430 create table test.t3 (a int primary key) engine=ndb;
2431 ERROR HY000: Error in parsing conflict function. Message: NDB$EPOCH(32), Too many extra Gci bits at ')'
2432 show warnings;
2433 Level Code Message
2434 Error 1626 Error in parsing conflict function. Message: NDB$EPOCH(32), Too many extra Gci bits at ')'
2435 Error 1031 Table storage engine for 't3' doesn't have this option
2436 create table test.t4 (a int primary key) engine=ndb;
2437 ERROR HY000: Error in parsing conflict function. Message: NDB$EPOCH(-1), Too many extra Gci bits at ')'
2438 show warnings;
2439 Level Code Message
2440 Error 1626 Error in parsing conflict function. Message: NDB$EPOCH(-1), Too many extra Gci bits at ')'
2441 Error 1031 Table storage engine for 't4' doesn't have this option
2442 -- Force sync before dropping table to avoid race
2443 flush logs;
2444 flush logs;
2445 drop table mysql.ndb_replication;
2446 -- Attempt to get system back in pre-test state
2447 stop replica;
2448 reset replica;
2449 include/rpl_end.inc