Debian Codegraph @

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

raw
1 --source include/have_innodb.inc
2 --source include/have_binlog_format_statement.inc
3 --let $rpl_topology=1->2
4 --source include/rpl_init.inc
5
6 --disable_query_log
7 call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
8 --enable_query_log
9
10 --connection server_1
11 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
12 CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
13 CREATE TABLE t2 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
14 INSERT INTO t1 VALUES (1,0), (2,0), (3,0);
15 INSERT INTO t2 VALUES (1,0), (2,0);
16 --save_master_pos
17
18
19 --connection server_2
20 --sync_with_master
21 SET @old_isolation= @@GLOBAL.transaction_isolation;
22 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
23 --source include/stop_slave.inc
24 SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
25 SET GLOBAL slave_parallel_threads=10;
26 CHANGE MASTER TO master_use_gtid=slave_pos;
27 SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
28 SET GLOBAL slave_parallel_mode='aggressive';
29
30
31 --echo *** Test that we replicate correctly when using READ COMMITTED and --log-slave-updates=0 on the slave ***
32
33 --connection server_1
34
35 INSERT INTO t1 SELECT 4, COUNT(*) FROM t2;
36 INSERT INTO t2 SELECT 4, COUNT(*) FROM t1;
37
38 INSERT INTO t1 SELECT 5, COUNT(*) FROM t2;
39 INSERT INTO t2 SELECT 5, COUNT(*) FROM t1;
40
41 INSERT INTO t2 SELECT 6, COUNT(*) FROM t1;
42 INSERT INTO t1 SELECT 6, COUNT(*) FROM t2;
43
44 INSERT INTO t1 SELECT 7, COUNT(*) FROM t2;
45 INSERT INTO t2 SELECT 7, COUNT(*) FROM t1;
46
47 INSERT INTO t2 SELECT 8, COUNT(*) FROM t1;
48 INSERT INTO t1 SELECT 8, COUNT(*) FROM t2;
49
50 INSERT INTO t2 SELECT 9, COUNT(*) FROM t1;
51 INSERT INTO t1 SELECT 9, COUNT(*) FROM t2;
52
53 INSERT INTO t1 SELECT 10, COUNT(*) FROM t2;
54 INSERT INTO t2 SELECT 10, COUNT(*) FROM t1;
55
56 SELECT * FROM t1 ORDER BY a;
57 SELECT * FROM t2 ORDER BY a;
58 --source include/save_master_gtid.inc
59
60 --connection server_2
61 --source include/start_slave.inc
62 --source include/sync_with_master_gtid.inc
63 SELECT * FROM t1 ORDER BY a;
64 SELECT * FROM t2 ORDER BY a;
65
66
67 --connection server_2
68 --source include/stop_slave.inc
69 SET GLOBAL transaction_isolation= @old_isolation;
70 SET GLOBAL slave_parallel_mode=@old_parallel_mode;
71 SET GLOBAL slave_parallel_threads=@old_parallel_threads;
72 --source include/start_slave.inc
73
74 --connection server_1
75 DROP TABLE t1, t2;
76
77 --connection server_2
78 call mtr.add_suppression("Deadlock found when trying to get lock.*");
79
80 --source include/rpl_end.inc
81