Debian Codegraph @

mysql-test/suite/rpl/t/rpl_mts_submode_switch_without_reset_slave_myisam.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/force_myisam_default.inc
9 --source include/have_myisam.inc
10 --source include/master-slave.inc
11 --let $saved_debug=`SELECT @@global.DEBUG`
12 SET GLOBAL DEBUG ='+d,set_commit_parent_150';
13
14 --connection slave
15
16 # save MTS submode
17 --let $saved_submode= `SELECT @@replica_parallel_type`
18 SET @slave_preserver_commit_order_saved= @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER;
19
20 --source include/stop_slave.inc
21
22 #setup 2 connections to master
23 --connect(m2, localhost,root,,,$MASTER_MYPORT)
24
25 --echo #setup the databases and tables
26 --connection m2
27 CREATE DATABASE db2;
28 CREATE TABLE db2.t (a int) engine=myisam;
29
30 --connection master
31 SET GLOBAL DEBUG ='-d,set_commit_parent_150';
32 SET GLOBAL DEBUG ='+d,set_commit_parent_100';
33
34 --connection m2
35 INSERT INTO db2.t values (1),(2),(3);
36
37 # DEFAULT ========> DATABASE
38 --connection slave
39 SET GLOBAL replica_parallel_type='DATABASE';
40 # Switching off replica-preserve-commit-order
41 SET GLOBAL replica_preserve_commit_order=0;
42 --source include/start_slave.inc
43 --connection master
44 --source include/sync_slave_sql_with_master.inc
45 --let diff_tables= master:db2.t, slave:db2.t
46 --source include/diff_tables.inc
47 --source include/stop_slave.inc
48
49 --connection master
50 SET GLOBAL DEBUG ='-d,set_commit_parent_100';
51 SET GLOBAL DEBUG ='+d,set_commit_parent_150';
52
53 --connection m2
54 INSERT INTO db2.t values (1),(2),(3);
55
56 # DATABASE ========> LOGICAL_CLOCK
57 --connection slave
58 SET GLOBAL replica_parallel_type='LOGICAL_CLOCK';
59 # Switching on replica-preserve-commit-order
60 SET GLOBAL replica_preserve_commit_order=1;
61 --source include/start_slave.inc
62 --connection master
63 --source include/sync_slave_sql_with_master.inc
64 --let diff_tables= master:db2.t, slave:db2.t
65 --source include/diff_tables.inc
66 --source include/stop_slave.inc
67
68 --connection master
69 SET GLOBAL DEBUG ='-d,set_commit_parent_150';
70 SET GLOBAL DEBUG ='+d,set_commit_parent_100';
71
72 --connection m2
73 INSERT INTO db2.t values (1),(2),(3);
74
75 # LOGICAL_CLOCK ========> DATABASE
76 --connection slave
77 SET GLOBAL replica_parallel_type='DATABASE';
78 # Switching off replica-preserve-commit-order
79 SET GLOBAL replica_preserve_commit_order=0;
80 --source include/start_slave.inc
81 --connection master
82 --source include/sync_slave_sql_with_master.inc
83 --let diff_tables= master:db2.t, slave:db2.t
84 --source include/diff_tables.inc
85
86
87 #clean up
88 --connection master
89 DROP DATABASE db2;
90 --source include/sync_slave_sql_with_master.inc
91
92 --connection slave
93
94 --source include/stop_slave.inc
95 --disable_query_log
96 --disable_result_log
97 --eval SET GLOBAL replica_parallel_type= '$saved_submode'
98 SET GLOBAL replica_preserve_commit_order=@slave_preserver_commit_order_saved;
99 --source include/start_slave.inc
100 --connection master
101 --eval SET GLOBAL DEBUG='$saved_debug'
102 --enable_query_log
103 --enable_result_log
104
105 --source include/rpl_end.inc