Debian Codegraph @

mysql-test/suite/rpl/r/rpl_parallel_retry_deadlock.result

raw
1 *** MDEV-7326 Server deadlock in connection with parallel replication ***
2 include/master-slave.inc
3 [connection master]
4 connection server_2;
5 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
6 SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
7 include/stop_slave.inc
8 SET GLOBAL slave_parallel_mode='conservative';
9 SET GLOBAL slave_parallel_threads=10;
10 CHANGE MASTER TO master_use_gtid=slave_pos;
11 include/start_slave.inc
12 connection server_1;
13 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
14 CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
15 CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
16 CREATE TABLE t6 (a INT) ENGINE=MyISAM;
17 connection server_2;
18 connection server_1;
19 SET sql_log_bin=0;
20 CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
21 RETURNS INT DETERMINISTIC
22 BEGIN
23 RETURN x;
24 END
25 ||
26 SET sql_log_bin=1;
27 connection server_2;
28 SET sql_log_bin=0;
29 CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
30 RETURNS INT DETERMINISTIC
31 BEGIN
32 IF d1 != '' THEN
33 SET debug_sync = d1;
34 END IF;
35 IF d2 != '' THEN
36 SET debug_sync = d2;
37 END IF;
38 RETURN x;
39 END
40 ||
41 SET sql_log_bin=1;
42 connection server_2;
43 include/stop_slave.inc
44 SET GLOBAL slave_parallel_threads=0;
45 SET GLOBAL slave_parallel_threads=3;
46 SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
47 include/start_slave.inc
48 connection server_1;
49 SET @old_format= @@SESSION.binlog_format;
50 SET binlog_format= STATEMENT;
51 INSERT INTO t1 VALUES (foo(50,
52 "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
53 "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
54 connection server_2;
55 SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
56 connection server_1;
57 INSERT INTO t2 VALUES (foo(50,
58 "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
59 "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
60 connection server_2;
61 SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
62 connection server_1;
63 INSERT INTO t1 VALUES (foo(51,
64 "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
65 "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
66 connection server_2;
67 SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
68 SET DEBUG_SYNC= "now SIGNAL t1_cont1";
69 SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
70 connection server_1;
71 INSERT INTO t1 VALUES (52);
72 SET BINLOG_FORMAT= @old_format;
73 SELECT * FROM t2 WHERE a>=50 ORDER BY a;
74 a
75 50
76 SELECT * FROM t1 WHERE a>=50 ORDER BY a;
77 a
78 50
79 51
80 52
81 connection server_2;
82 SET DEBUG_SYNC= "now SIGNAL prep_cont";
83 SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
84 SET DEBUG_SYNC= "now SIGNAL t2_cont1";
85 SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
86 SET DEBUG_SYNC= "now SIGNAL t1_cont2";
87 connection server_1;
88 connection server_2;
89 SELECT * FROM t2 WHERE a>=50 ORDER BY a;
90 a
91 50
92 SELECT * FROM t1 WHERE a>=50 ORDER BY a;
93 a
94 50
95 51
96 52
97 SET DEBUG_SYNC="reset";
98 include/stop_slave.inc
99 SET GLOBAL debug_dbug=@old_dbug;
100 SET GLOBAL slave_parallel_mode=@old_parallel_mode;
101 SET GLOBAL slave_parallel_threads=0;
102 SET GLOBAL slave_parallel_threads=10;
103 include/start_slave.inc
104 *** MDEV-7326 Server deadlock in connection with parallel replication ***
105 connect con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
106 connect con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
107 connection server_2;
108 include/stop_slave.inc
109 SET @old_parallel_mode= @@GLOBAL.slave_parallel_mode;
110 SET GLOBAL slave_parallel_mode='conservative';
111 SET GLOBAL slave_parallel_threads=0;
112 SET GLOBAL slave_parallel_threads=3;
113 SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
114 include/start_slave.inc
115 connection server_1;
116 SET @old_format= @@SESSION.binlog_format;
117 SET binlog_format= STATEMENT;
118 INSERT INTO t1 VALUES (foo(60,
119 "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
120 "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
121 connection server_2;
122 SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
123 connection server_1;
124 INSERT INTO t2 VALUES (foo(60,
125 "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
126 "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
127 connection server_2;
128 SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
129 connection con_temp3;
130 SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
131 SET binlog_format=statement;
132 INSERT INTO t1 VALUES (foo(61,
133 "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
134 "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
135 connection server_1;
136 SET debug_sync='now WAIT_FOR master_queued1';
137 connection con_temp4;
138 SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
139 INSERT INTO t6 VALUES (62);
140 connection server_1;
141 SET debug_sync='now WAIT_FOR master_queued2';
142 SET debug_sync='now SIGNAL master_cont1';
143 connection con_temp3;
144 connection con_temp4;
145 connection server_1;
146 SET debug_sync='RESET';
147 SET BINLOG_FORMAT= @old_format;
148 SELECT * FROM t2 WHERE a>=60 ORDER BY a;
149 a
150 60
151 SELECT * FROM t1 WHERE a>=60 ORDER BY a;
152 a
153 60
154 61
155 SELECT * FROM t6 WHERE a>=60 ORDER BY a;
156 a
157 62
158 connection server_2;
159 SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
160 SET DEBUG_SYNC= "now SIGNAL t1_cont1";
161 SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
162 connection server_2;
163 SET DEBUG_SYNC= "now SIGNAL prep_cont";
164 SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
165 SET DEBUG_SYNC= "now SIGNAL t2_cont1";
166 SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
167 SET DEBUG_SYNC= "now SIGNAL t1_cont2";
168 connection server_1;
169 connection server_2;
170 SELECT * FROM t2 WHERE a>=60 ORDER BY a;
171 a
172 60
173 SELECT * FROM t1 WHERE a>=60 ORDER BY a;
174 a
175 60
176 61
177 SELECT * FROM t6 WHERE a>=60 ORDER BY a;
178 a
179 62
180 SET DEBUG_SYNC="reset";
181 include/stop_slave.inc
182 SET GLOBAL debug_dbug=@old_dbug;
183 SET GLOBAL slave_parallel_mode=@old_parallel_mode;
184 SET GLOBAL slave_parallel_threads=@old_parallel_threads;
185 include/start_slave.inc
186 connection server_1;
187 DROP function foo;
188 DROP TABLE t1,t2,t6;
189 disconnect con_temp3;
190 disconnect con_temp4;
191 SET DEBUG_SYNC= 'RESET';
192 include/rpl_end.inc