1--source include/have_innodb.inc
2--let $rpl_topology=1->2->3
3--source include/rpl_init.inc
4
5--echo *** MDEV-7668: Intermediate master groups CREATE with INSERT, causing parallel replication failure ***
6
7--connection server_1
8SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
9SET GLOBAL binlog_direct_non_transactional_updates=OFF;
10SET SESSION binlog_direct_non_transactional_updates=OFF;
11ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
12CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
13--save_master_pos
14
15--connection server_2
16--sync_with_master
17--save_master_pos
18--source include/stop_slave.inc
19SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
20SET GLOBAL slave_parallel_threads=10;
21SET @old_commit_count=@@GLOBAL.binlog_commit_wait_count;
22SET GLOBAL binlog_commit_wait_count=2;
23SET @old_commit_usec=@@GLOBAL.binlog_commit_wait_usec;
24SET GLOBAL binlog_commit_wait_usec=2000000;
25SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
26SET GLOBAL binlog_direct_non_transactional_updates=OFF;
27SET SESSION binlog_direct_non_transactional_updates=OFF;
28CHANGE MASTER TO master_use_gtid=current_pos;
29
30--connection server_3
31--sync_with_master
32--save_master_pos
33SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
34--source include/stop_slave.inc
35SET GLOBAL slave_parallel_threads=10;
36CHANGE MASTER TO master_use_gtid=current_pos;
37
38
39--connection server_1
40
41BEGIN;
42CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=MEMORY;
43COMMIT;
44INSERT INTO t2 VALUES (1);
45INSERT INTO t1 SELECT a, a*10 FROM t2;
46DROP TABLE t2;
47--source include/save_master_gtid.inc
48
49--connection server_2
50--source include/start_slave.inc
51--source include/sync_with_master_gtid.inc
52SELECT * FROM t1 ORDER BY a;
53
54--connection server_3
55--source include/start_slave.inc
56--source include/sync_with_master_gtid.inc
57SELECT * FROM t1 ORDER BY a;
58
59
60# Clean up
61
62--connection server_2
63--source include/stop_slave.inc
64SET GLOBAL slave_parallel_threads=@old_parallel_threads;
65SET GLOBAL binlog_commit_wait_count=@old_commit_count;
66SET GLOBAL binlog_commit_wait_usec=@old_commit_usec;
67SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
68--source include/start_slave.inc
69
70--connection server_3
71--source include/stop_slave.inc
72SET GLOBAL slave_parallel_threads=@old_parallel_threads;
73--source include/start_slave.inc
74
75--connection server_1
76SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
77CALL mtr.add_suppression("Statement accesses nontransactional table as well as transactional or temporary table");
78DROP TABLE t1;
79
80--source include/rpl_end.inc
81