Debian Codegraph @

mysql-test/suite/rpl/t/rpl_parallel_deadlock_corrupt_binlog.test

raw
1 --echo *** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption ***
2 --source include/have_innodb.inc
3 --source include/have_debug.inc
4 --source include/have_debug_sync.inc
5 --source include/master-slave.inc
6
7 --connection server_2
8 --source include/stop_slave.inc
9 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
10 SET GLOBAL slave_parallel_threads=10;
11 CHANGE MASTER TO master_use_gtid=slave_pos;
12 --source include/start_slave.inc
13
14 --connection server_1
15 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
16 CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
17 --save_master_pos
18
19 --connection server_2
20 --sync_with_master
21 --source include/stop_slave.inc
22 SET GLOBAL slave_parallel_threads=1;
23 SET @old_dbug= @@GLOBAL.debug_dbug;
24 SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
25 CALL mtr.add_suppression("Unexpected break of being relay-logged GTID");
26
27 --connection server_1
28 INSERT INTO t2 VALUES (101);
29 INSERT INTO t2 VALUES (102);
30 INSERT INTO t2 VALUES (103);
31 INSERT INTO t2 VALUES (104);
32 INSERT INTO t2 VALUES (105);
33 # Inject a partial event group (missing XID at the end). The bug was that such
34 # partial group was not handled appropriately, leading to server deadlock.
35 SET gtid_seq_no=1000;
36 INSERT INTO t2 VALUES (106);
37 INSERT INTO t2 VALUES (107);
38 INSERT INTO t2 VALUES (108);
39 INSERT INTO t2 VALUES (109);
40 INSERT INTO t2 VALUES (110);
41 INSERT INTO t2 VALUES (111);
42 INSERT INTO t2 VALUES (112);
43 INSERT INTO t2 VALUES (113);
44 INSERT INTO t2 VALUES (114);
45 INSERT INTO t2 VALUES (115);
46 INSERT INTO t2 VALUES (116);
47 INSERT INTO t2 VALUES (117);
48 INSERT INTO t2 VALUES (118);
49 INSERT INTO t2 VALUES (119);
50 INSERT INTO t2 VALUES (120);
51 INSERT INTO t2 VALUES (121);
52 INSERT INTO t2 VALUES (122);
53 INSERT INTO t2 VALUES (123);
54 INSERT INTO t2 VALUES (124);
55 INSERT INTO t2 VALUES (125);
56 INSERT INTO t2 VALUES (126);
57 INSERT INTO t2 VALUES (127);
58 INSERT INTO t2 VALUES (128);
59 INSERT INTO t2 VALUES (129);
60 INSERT INTO t2 VALUES (130);
61 --source include/save_master_gtid.inc
62
63 --connection server_2
64 --source include/start_slave.inc
65 --source include/sync_with_master_gtid.inc
66 # The partial event group (a=106) should be rolled back and thus missing.
67 SELECT * FROM t2 WHERE a >= 100 ORDER BY a;
68
69 # Cleanup
70 --source include/stop_slave.inc
71 SET GLOBAL debug_dbug=@old_dbug;
72 SET GLOBAL slave_parallel_threads=@old_parallel_threads;
73 --source include/start_slave.inc
74 SET DEBUG_SYNC= 'RESET';
75
76 --connection server_1
77 DROP TABLE t2;
78 SET DEBUG_SYNC= 'RESET';
79
80 --source include/rpl_end.inc