Debian Codegraph @

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

raw
1 # The motive of this test case is to test the
2 # mts submode switch between master parallel to dbname and vice-versa
3 # without using RESET SLAVE. The idea is that the two submode should work
4 # seamlessly.
5
6 --source include/have_debug.inc
7 --source include/not_group_replication_plugin.inc
8 --source include/master-slave.inc
9 --let $saved_debug=`SELECT @@global.DEBUG`
10 SET GLOBAL DEBUG ='+d,set_commit_parent_150';
11
12 --connection slave
13
14 # save MTS submode
15 --let $saved_submode= `SELECT @@replica_parallel_type`
16 SET @saved_rpco= @@GLOBAL.replica_preserve_commit_order;
17 --source include/stop_slave.inc
18 SET GLOBAL replica_preserve_commit_order=OFF;
19
20 #setup 2 connections to master
21 --connect(m1, localhost,root,,,$MASTER_MYPORT)
22 --connect(m2, localhost,root,,,$MASTER_MYPORT)
23
24 --echo #setup the databases and tables
25 --connection m1
26 CREATE DATABASE db1;
27 CREATE TABLE db1.t (a int) engine=innodb;
28
29 --connection master
30 SET GLOBAL DEBUG ='-d,set_commit_parent_150';
31 SET GLOBAL DEBUG ='+d,set_commit_parent_100';
32
33 --connection m1
34 INSERT INTO db1.t values (1),(2),(3);
35
36 # DEFAULT ========> DATABASE
37 --connection slave
38 SET GLOBAL replica_parallel_type='DATABASE';
39 --source include/start_slave.inc
40 --connection master
41 --source include/sync_slave_sql_with_master.inc
42 --let diff_tables= master:db1.t,slave:db1.t
43 --source include/diff_tables.inc
44 --source include/stop_slave.inc
45
46 --connection master
47 SET GLOBAL DEBUG ='-d,set_commit_parent_100';
48 SET GLOBAL DEBUG ='+d,set_commit_parent_150';
49
50 --connection m1
51 INSERT INTO db1.t values (1),(2),(3);
52
53 # DATABASE ========> LOGICAL_CLOCK
54 --connection slave
55 SET GLOBAL replica_parallel_type='LOGICAL_CLOCK';
56 --source include/start_slave.inc
57 --connection master
58 --source include/sync_slave_sql_with_master.inc
59 --let diff_tables= master:db1.t,slave:db1.t
60 --source include/diff_tables.inc
61 --source include/stop_slave.inc
62
63 --connection master
64 SET GLOBAL DEBUG ='-d,set_commit_parent_150';
65 SET GLOBAL DEBUG ='+d,set_commit_parent_100';
66
67 --connection m1
68 INSERT INTO db1.t values (1),(2),(3);
69
70 # LOGICAL_CLOCK ========> DATABASE
71 --connection slave
72 SET GLOBAL replica_parallel_type='DATABASE';
73 --source include/start_slave.inc
74 --connection master
75 --source include/sync_slave_sql_with_master.inc
76 --let diff_tables= master:db1.t,slave:db1.t
77 --source include/diff_tables.inc
78
79
80 #clean up
81 --connection master
82 DROP DATABASE db1;
83 --source include/sync_slave_sql_with_master.inc
84
85 --connection slave
86
87 --source include/stop_slave.inc
88 --disable_query_log
89 --disable_result_log
90 --eval SET GLOBAL replica_parallel_type= '$saved_submode'
91 SET GLOBAL replica_preserve_commit_order=@saved_rpco;
92 --source include/start_slave.inc
93 --connection master
94 --eval SET GLOBAL DEBUG='$saved_debug'
95 --enable_query_log
96 --enable_result_log
97
98 --source include/rpl_end.inc