| 1 |
***MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts *** |
| 2 |
include/master-slave.inc |
| 3 |
[connection master] |
| 4 |
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; |
| 5 |
CALL mtr.add_suppression("InnoDB: Transaction was aborted due to "); |
| 6 |
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); |
| 7 |
connection server_2; |
| 8 |
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; |
| 9 |
include/stop_slave.inc |
| 10 |
SET GLOBAL slave_parallel_threads=10; |
| 11 |
CHANGE MASTER TO master_use_gtid=slave_pos; |
| 12 |
connection server_1; |
| 13 |
CREATE TABLE t4 (a INT PRIMARY KEY, b INT, KEY b_idx(b)) ENGINE=InnoDB; |
| 14 |
INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6); |
| 15 |
connect con1,127.0.0.1,root,,test,$SERVER_MYPORT_1,; |
| 16 |
connect con2,127.0.0.1,root,,test,$SERVER_MYPORT_1,; |
| 17 |
connection con1; |
| 18 |
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; |
| 19 |
UPDATE t4 SET b=NULL WHERE a=6; |
| 20 |
connection server_1; |
| 21 |
SET debug_sync='now WAIT_FOR master_queued1'; |
| 22 |
connection con2; |
| 23 |
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; |
| 24 |
DELETE FROM t4 WHERE b <= 3; |
| 25 |
connection server_1; |
| 26 |
SET debug_sync='now WAIT_FOR master_queued2'; |
| 27 |
SET debug_sync='now SIGNAL master_cont1'; |
| 28 |
connection con1; |
| 29 |
connection con2; |
| 30 |
SET debug_sync='RESET'; |
| 31 |
connection server_2; |
| 32 |
include/start_slave.inc |
| 33 |
include/stop_slave.inc |
| 34 |
SELECT * FROM t4 ORDER BY a; |
| 35 |
a b |
| 36 |
1 NULL |
| 37 |
3 NULL |
| 38 |
4 4 |
| 39 |
5 NULL |
| 40 |
6 NULL |
| 41 |
connection server_1; |
| 42 |
DELETE FROM t4; |
| 43 |
INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6); |
| 44 |
connection con1; |
| 45 |
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; |
| 46 |
INSERT INTO t4 VALUES (7, NULL); |
| 47 |
connection server_1; |
| 48 |
SET debug_sync='now WAIT_FOR master_queued1'; |
| 49 |
connection con2; |
| 50 |
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; |
| 51 |
DELETE FROM t4 WHERE b <= 3; |
| 52 |
connection server_1; |
| 53 |
SET debug_sync='now WAIT_FOR master_queued2'; |
| 54 |
SET debug_sync='now SIGNAL master_cont1'; |
| 55 |
connection con1; |
| 56 |
connection con2; |
| 57 |
SET debug_sync='RESET'; |
| 58 |
connection server_2; |
| 59 |
include/start_slave.inc |
| 60 |
include/stop_slave.inc |
| 61 |
SELECT * FROM t4 ORDER BY a; |
| 62 |
a b |
| 63 |
1 NULL |
| 64 |
3 NULL |
| 65 |
4 4 |
| 66 |
5 NULL |
| 67 |
6 6 |
| 68 |
7 NULL |
| 69 |
connection server_2; |
| 70 |
SET GLOBAL slave_parallel_threads=@old_parallel_threads; |
| 71 |
include/start_slave.inc |
| 72 |
SET DEBUG_SYNC= 'RESET'; |
| 73 |
connection server_1; |
| 74 |
disconnect con1; |
| 75 |
disconnect con2; |
| 76 |
DROP TABLE t4; |
| 77 |
SET DEBUG_SYNC= 'RESET'; |
| 78 |
include/rpl_end.inc |