Debian Codegraph @

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

raw
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
8 SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
9 SET GLOBAL binlog_direct_non_transactional_updates=OFF;
10 SET SESSION binlog_direct_non_transactional_updates=OFF;
11 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
12 CREATE 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
19 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
20 SET GLOBAL slave_parallel_threads=10;
21 SET @old_commit_count=@@GLOBAL.binlog_commit_wait_count;
22 SET GLOBAL binlog_commit_wait_count=2;
23 SET @old_commit_usec=@@GLOBAL.binlog_commit_wait_usec;
24 SET GLOBAL binlog_commit_wait_usec=2000000;
25 SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
26 SET GLOBAL binlog_direct_non_transactional_updates=OFF;
27 SET SESSION binlog_direct_non_transactional_updates=OFF;
28
29 --connection server_3
30 --sync_with_master
31 --save_master_pos
32 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
33 --source include/stop_slave.inc
34 SET GLOBAL slave_parallel_threads=10;
35
36
37 --connection server_1
38
39 BEGIN;
40 CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=MEMORY;
41 COMMIT;
42 INSERT INTO t2 VALUES (1);
43 INSERT INTO t1 SELECT a, a*10 FROM t2;
44 DROP TABLE t2;
45 --source include/save_master_gtid.inc
46
47 --connection server_2
48 --source include/start_slave.inc
49 --source include/sync_with_master_gtid.inc
50 SELECT * FROM t1 ORDER BY a;
51
52 --connection server_3
53 --source include/start_slave.inc
54 --source include/sync_with_master_gtid.inc
55 SELECT * FROM t1 ORDER BY a;
56
57
58 # Clean up
59
60 --connection server_2
61 --source include/stop_slave.inc
62 SET GLOBAL slave_parallel_threads=@old_parallel_threads;
63 SET GLOBAL binlog_commit_wait_count=@old_commit_count;
64 SET GLOBAL binlog_commit_wait_usec=@old_commit_usec;
65 SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
66 --source include/start_slave.inc
67
68 --connection server_3
69 --source include/stop_slave.inc
70 SET GLOBAL slave_parallel_threads=@old_parallel_threads;
71 --source include/start_slave.inc
72
73 --connection server_1
74 SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
75 CALL mtr.add_suppression("Statement accesses nontransactional table as well as transactional or temporary table");
76 DROP TABLE t1;
77
78 --source include/rpl_end.inc