Skip to content

Commit 5f55f69

Browse files
committed
Merge 10.1 into 10.2
2 parents efc70da + 3f019d1 commit 5f55f69

File tree

12 files changed

+1056
-11
lines changed

12 files changed

+1056
-11
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
CREATE TABLE t1 (f1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
2+
CREATE TABLE t2 (f1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT, f2 INT) ENGINE=InnoDB;
3+
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NULL, NEW.f1);
4+
connection node_2;
5+
SET SESSION wsrep_sync_wait = 0;
6+
SET GLOBAL wsrep_slave_threads = 2;
7+
SET GLOBAL debug_dbug = 'd,sync.mdev_20225';
8+
DROP TRIGGER tr1;
9+
connection node_2;
10+
connection node_1;
11+
INSERT INTO t1 VALUES (NULL);
12+
connection node_2;
13+
SET GLOBAL debug_dbug = 'RESET';
14+
SET DEBUG_SYNC = 'now SIGNAL signal.mdev_20225_continue';
15+
SET DEBUG_SYNC = 'RESET';
16+
SET GLOBAL wsrep_slave_threads = 1;
17+
SHOW TRIGGERS;
18+
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
19+
DROP TABLE t1;
20+
DROP TABLE t2;
Lines changed: 360 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,360 @@
1+
connection node_1;
2+
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
3+
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
4+
connection node_1a;
5+
SET SESSION wsrep_sync_wait = 0;
6+
connection node_1;
7+
CREATE PROCEDURE proc_update_insert()
8+
BEGIN
9+
UPDATE t1 SET f2 = 'b';
10+
INSERT INTO t1 VALUES (4, 'd');
11+
END|
12+
INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
13+
SET SESSION wsrep_sync_wait = 0;
14+
connection node_1a;
15+
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
16+
connection node_2;
17+
INSERT INTO t1 VALUES (2, 'c');
18+
connection node_1a;
19+
SET SESSION wsrep_on = 0;
20+
SET SESSION wsrep_on = 1;
21+
SET GLOBAL wsrep_provider_options = 'dbug=';
22+
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
23+
connection node_1;
24+
CALL proc_update_insert;
25+
connection node_1a;
26+
SET SESSION wsrep_on = 0;
27+
SET SESSION wsrep_on = 1;
28+
SET GLOBAL wsrep_provider_options = 'dbug=';
29+
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
30+
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
31+
connection node_1;
32+
SET SESSION wsrep_sync_wait = default;
33+
SELECT * FROM t1;
34+
f1 f2
35+
1 b
36+
2 c
37+
3 b
38+
4 d
39+
wsrep_local_replays
40+
1
41+
DELETE FROM t1;
42+
connection node_1;
43+
CREATE PROCEDURE proc_update_insert_with_exit_handler()
44+
BEGIN
45+
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;
46+
UPDATE t1 SET f2 = 'b';
47+
INSERT INTO t1 VALUES (4, 'd');
48+
END|
49+
INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
50+
SET SESSION wsrep_sync_wait = 0;
51+
connection node_1a;
52+
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
53+
connection node_2;
54+
INSERT INTO t1 VALUES (2, 'c');
55+
connection node_1a;
56+
SET SESSION wsrep_on = 0;
57+
SET SESSION wsrep_on = 1;
58+
SET GLOBAL wsrep_provider_options = 'dbug=';
59+
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
60+
connection node_1;
61+
CALL proc_update_insert_with_exit_handler;
62+
connection node_1a;
63+
SET SESSION wsrep_on = 0;
64+
SET SESSION wsrep_on = 1;
65+
SET GLOBAL wsrep_provider_options = 'dbug=';
66+
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
67+
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
68+
connection node_1;
69+
SET SESSION wsrep_sync_wait = default;
70+
SELECT * FROM t1;
71+
f1 f2
72+
1 b
73+
2 c
74+
3 b
75+
4 d
76+
wsrep_local_replays
77+
1
78+
DELETE FROM t1;
79+
connection node_1;
80+
CREATE PROCEDURE proc_update_insert_with_continue_handler()
81+
BEGIN
82+
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
83+
UPDATE t1 SET f2 = 'b';
84+
INSERT INTO t1 VALUES (4, 'd');
85+
END|
86+
INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
87+
SET SESSION wsrep_sync_wait = 0;
88+
connection node_1a;
89+
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
90+
connection node_2;
91+
INSERT INTO t1 VALUES (2, 'c');
92+
connection node_1a;
93+
SET SESSION wsrep_on = 0;
94+
SET SESSION wsrep_on = 1;
95+
SET GLOBAL wsrep_provider_options = 'dbug=';
96+
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
97+
connection node_1;
98+
CALL proc_update_insert_with_continue_handler;
99+
connection node_1a;
100+
SET SESSION wsrep_on = 0;
101+
SET SESSION wsrep_on = 1;
102+
SET GLOBAL wsrep_provider_options = 'dbug=';
103+
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
104+
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
105+
connection node_1;
106+
SET SESSION wsrep_sync_wait = default;
107+
SELECT * FROM t1;
108+
f1 f2
109+
1 b
110+
2 c
111+
3 b
112+
4 d
113+
wsrep_local_replays
114+
1
115+
DELETE FROM t1;
116+
connection node_1;
117+
CREATE PROCEDURE proc_update_insert_transaction()
118+
BEGIN
119+
START TRANSACTION;
120+
UPDATE t1 SET f2 = 'b';
121+
INSERT INTO t1 VALUES (4, 'd');
122+
COMMIT;
123+
END|
124+
INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
125+
SET SESSION wsrep_sync_wait = 0;
126+
connection node_1a;
127+
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
128+
connection node_2;
129+
INSERT INTO t1 VALUES (2, 'c');
130+
connection node_1a;
131+
SET SESSION wsrep_on = 0;
132+
SET SESSION wsrep_on = 1;
133+
SET GLOBAL wsrep_provider_options = 'dbug=';
134+
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
135+
connection node_1;
136+
CALL proc_update_insert_transaction;
137+
connection node_1a;
138+
SET SESSION wsrep_on = 0;
139+
SET SESSION wsrep_on = 1;
140+
SET GLOBAL wsrep_provider_options = 'dbug=';
141+
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
142+
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
143+
connection node_1;
144+
Warnings:
145+
Error 1317 Query execution was interrupted
146+
SET SESSION wsrep_sync_wait = default;
147+
SELECT * FROM t1;
148+
f1 f2
149+
1 b
150+
2 c
151+
3 b
152+
4 d
153+
wsrep_local_replays
154+
1
155+
DELETE FROM t1;
156+
connection node_1;
157+
CREATE PROCEDURE proc_update_insert_transaction_with_continue_handler()
158+
BEGIN
159+
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
160+
START TRANSACTION;
161+
UPDATE t1 SET f2 = 'b';
162+
INSERT INTO t1 VALUES (4, 'd');
163+
COMMIT;
164+
END|
165+
INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
166+
SET SESSION wsrep_sync_wait = 0;
167+
connection node_1a;
168+
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
169+
connection node_2;
170+
INSERT INTO t1 VALUES (2, 'c');
171+
connection node_1a;
172+
SET SESSION wsrep_on = 0;
173+
SET SESSION wsrep_on = 1;
174+
SET GLOBAL wsrep_provider_options = 'dbug=';
175+
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
176+
connection node_1;
177+
CALL proc_update_insert_transaction_with_continue_handler;
178+
connection node_1a;
179+
SET SESSION wsrep_on = 0;
180+
SET SESSION wsrep_on = 1;
181+
SET GLOBAL wsrep_provider_options = 'dbug=';
182+
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
183+
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
184+
connection node_1;
185+
Warnings:
186+
Error 1317 Query execution was interrupted
187+
SET SESSION wsrep_sync_wait = default;
188+
SELECT * FROM t1;
189+
f1 f2
190+
1 b
191+
2 c
192+
3 b
193+
4 d
194+
wsrep_local_replays
195+
1
196+
DELETE FROM t1;
197+
connection node_1;
198+
CREATE PROCEDURE proc_update_insert_transaction_with_exit_handler()
199+
BEGIN
200+
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;
201+
START TRANSACTION;
202+
UPDATE t1 SET f2 = 'b';
203+
INSERT INTO t1 VALUES (4, 'd');
204+
COMMIT;
205+
END|
206+
INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
207+
SET SESSION wsrep_sync_wait = 0;
208+
connection node_1a;
209+
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
210+
connection node_2;
211+
INSERT INTO t1 VALUES (2, 'c');
212+
connection node_1a;
213+
SET SESSION wsrep_on = 0;
214+
SET SESSION wsrep_on = 1;
215+
SET GLOBAL wsrep_provider_options = 'dbug=';
216+
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
217+
connection node_1;
218+
CALL proc_update_insert_transaction_with_exit_handler;
219+
connection node_1a;
220+
SET SESSION wsrep_on = 0;
221+
SET SESSION wsrep_on = 1;
222+
SET GLOBAL wsrep_provider_options = 'dbug=';
223+
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
224+
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
225+
connection node_1;
226+
Warnings:
227+
Error 1317 Query execution was interrupted
228+
SET SESSION wsrep_sync_wait = default;
229+
SELECT * FROM t1;
230+
f1 f2
231+
1 b
232+
2 c
233+
3 b
234+
4 d
235+
wsrep_local_replays
236+
1
237+
DELETE FROM t1;
238+
connection node_1;
239+
CREATE PROCEDURE proc_insert_insert_conflict()
240+
BEGIN
241+
INSERT INTO t1 VALUES (2, 'd');
242+
INSERT INTO t1 VALUES (4, 'd');
243+
END|
244+
INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
245+
SET SESSION wsrep_sync_wait = 0;
246+
connection node_1a;
247+
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
248+
connection node_2;
249+
INSERT INTO t1 VALUES (2, 'c');
250+
connection node_1a;
251+
SET SESSION wsrep_on = 0;
252+
SET SESSION wsrep_on = 1;
253+
SET GLOBAL wsrep_provider_options = 'dbug=';
254+
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
255+
connection node_1;
256+
CALL proc_insert_insert_conflict;
257+
connection node_1a;
258+
SET SESSION wsrep_on = 0;
259+
SET SESSION wsrep_on = 1;
260+
SET GLOBAL wsrep_provider_options = 'dbug=';
261+
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
262+
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
263+
connection node_1;
264+
Got one of the listed errors
265+
SET SESSION wsrep_sync_wait = default;
266+
SELECT * FROM t1;
267+
f1 f2
268+
1 a
269+
2 c
270+
3 a
271+
wsrep_local_replays
272+
1
273+
DELETE FROM t1;
274+
connection node_1;
275+
CREATE PROCEDURE proc_insert_insert_conflict_with_exit_handler()
276+
BEGIN
277+
DECLARE EXIT HANDLER FOR SQLEXCEPTION SELECT "Conflict exit handler";
278+
INSERT INTO t1 VALUES (2, 'd');
279+
INSERT INTO t1 VALUES (4, 'd');
280+
END|
281+
INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
282+
SET SESSION wsrep_sync_wait = 0;
283+
connection node_1a;
284+
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
285+
connection node_2;
286+
INSERT INTO t1 VALUES (2, 'c');
287+
connection node_1a;
288+
SET SESSION wsrep_on = 0;
289+
SET SESSION wsrep_on = 1;
290+
SET GLOBAL wsrep_provider_options = 'dbug=';
291+
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
292+
connection node_1;
293+
CALL proc_insert_insert_conflict_with_exit_handler;
294+
connection node_1a;
295+
SET SESSION wsrep_on = 0;
296+
SET SESSION wsrep_on = 1;
297+
SET GLOBAL wsrep_provider_options = 'dbug=';
298+
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
299+
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
300+
connection node_1;
301+
Conflict exit handler
302+
Conflict exit handler
303+
SET SESSION wsrep_sync_wait = default;
304+
SELECT * FROM t1;
305+
f1 f2
306+
1 a
307+
2 c
308+
3 a
309+
wsrep_local_replays
310+
1
311+
DELETE FROM t1;
312+
connection node_1;
313+
CREATE PROCEDURE proc_insert_insert_conflict_with_continue_handler()
314+
BEGIN
315+
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SELECT "Conflict continue handler";
316+
INSERT INTO t1 VALUES (2, 'd');
317+
INSERT INTO t1 VALUES (4, 'd');
318+
END|
319+
INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
320+
SET SESSION wsrep_sync_wait = 0;
321+
connection node_1a;
322+
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
323+
connection node_2;
324+
INSERT INTO t1 VALUES (2, 'c');
325+
connection node_1a;
326+
SET SESSION wsrep_on = 0;
327+
SET SESSION wsrep_on = 1;
328+
SET GLOBAL wsrep_provider_options = 'dbug=';
329+
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
330+
connection node_1;
331+
CALL proc_insert_insert_conflict_with_continue_handler;
332+
connection node_1a;
333+
SET SESSION wsrep_on = 0;
334+
SET SESSION wsrep_on = 1;
335+
SET GLOBAL wsrep_provider_options = 'dbug=';
336+
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
337+
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
338+
connection node_1;
339+
Conflict continue handler
340+
Conflict continue handler
341+
SET SESSION wsrep_sync_wait = default;
342+
SELECT * FROM t1;
343+
f1 f2
344+
1 a
345+
2 c
346+
3 a
347+
4 d
348+
wsrep_local_replays
349+
1
350+
DELETE FROM t1;
351+
DROP PROCEDURE proc_update_insert;
352+
DROP PROCEDURE proc_update_insert_with_continue_handler;
353+
DROP PROCEDURE proc_update_insert_with_exit_handler;
354+
DROP PROCEDURE proc_update_insert_transaction;
355+
DROP PROCEDURE proc_update_insert_transaction_with_continue_handler;
356+
DROP PROCEDURE proc_update_insert_transaction_with_exit_handler;
357+
DROP PROCEDURE proc_insert_insert_conflict;
358+
DROP PROCEDURE proc_insert_insert_conflict_with_exit_handler;
359+
DROP PROCEDURE proc_insert_insert_conflict_with_continue_handler;
360+
DROP TABLE t1;

0 commit comments

Comments
 (0)