Debian Codegraph @

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

raw
1 --echo *** MDEV-6676 - test syntax of @@slave_parallel_mode ***
2
3 --source include/have_innodb.inc
4 --source include/have_debug.inc
5 --source include/master-slave.inc
6
7 --connection server_2
8 --source include/stop_slave.inc
9 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
10 SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
11 SET GLOBAL slave_parallel_threads=10;
12 CHANGE MASTER TO master_use_gtid=slave_pos;
13 --source include/start_slave.inc
14
15 --connection server_1
16 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
17 CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
18 --save_master_pos
19
20 --connection server_2
21 --sync_with_master
22
23 --let $status_items= Parallel_Mode
24 --source include/show_slave_status.inc
25 --source include/stop_slave.inc
26 SET GLOBAL slave_parallel_mode='aggressive';
27 --let $status_items= Parallel_Mode
28 --source include/show_slave_status.inc
29 SET GLOBAL slave_parallel_mode='conservative';
30 --let $status_items= Parallel_Mode
31 --source include/show_slave_status.inc
32
33 --echo *** MDEV-6676 - test that empty parallel_mode does not replicate in parallel ***
34 --connection server_1
35 INSERT INTO t2 VALUES (1040);
36 --source include/save_master_gtid.inc
37
38 --connection server_2
39 SET GLOBAL slave_parallel_mode='none';
40 # Test that we do not use parallel apply, by injecting an unconditional
41 # crash in the parallel apply code.
42 SET @old_dbug= @@GLOBAL.debug_dbug;
43 SET GLOBAL debug_dbug="+d,slave_crash_if_parallel_apply";
44 --source include/start_slave.inc
45 --source include/sync_with_master_gtid.inc
46 SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
47 --source include/stop_slave.inc
48 SET GLOBAL debug_dbug=@old_dbug;
49
50
51 --echo *** MDEV-6676 - test disabling domain-based parallel replication ***
52 --connection server_1
53 # Let's do a bunch of transactions that will conflict if run out-of-order in
54 # domain-based parallel replication mode.
55 SET gtid_domain_id = 1;
56 INSERT INTO t2 VALUES (1041);
57 INSERT INTO t2 VALUES (1042);
58 INSERT INTO t2 VALUES (1043);
59 INSERT INTO t2 VALUES (1044);
60 INSERT INTO t2 VALUES (1045);
61 INSERT INTO t2 VALUES (1046);
62 DELETE FROM t2 WHERE a >= 1041;
63 SET gtid_domain_id = 2;
64 INSERT INTO t2 VALUES (1041);
65 INSERT INTO t2 VALUES (1042);
66 INSERT INTO t2 VALUES (1043);
67 INSERT INTO t2 VALUES (1044);
68 INSERT INTO t2 VALUES (1045);
69 INSERT INTO t2 VALUES (1046);
70 SET gtid_domain_id = 0;
71 --source include/save_master_gtid.inc
72 --connection server_2
73 SET GLOBAL slave_parallel_mode=minimal;
74 --source include/start_slave.inc
75 --source include/sync_with_master_gtid.inc
76 SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
77
78 # Cleanup
79 --source include/stop_slave.inc
80 SET GLOBAL debug_dbug=@old_dbug;
81 SET GLOBAL slave_parallel_threads=@old_parallel_threads;
82 SET GLOBAL slave_parallel_mode=@old_parallel_mode;
83 --source include/start_slave.inc
84
85 --connection server_1
86 DROP TABLE t2;
87 --source include/rpl_end.inc