File: rpl_mts_submode_switch_without_reset_slave.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (98 lines) | stat: -rw-r--r-- 2,759 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# The motive of this test case is to test the
# mts submode switch between master parallel to dbname and vice-versa
# without using RESET SLAVE. The idea is that the two submode should work
# seamlessly.

--source include/have_debug.inc
--source include/not_group_replication_plugin.inc
--source include/master-slave.inc
--let $saved_debug=`SELECT @@global.DEBUG`
SET GLOBAL DEBUG ='+d,set_commit_parent_150';

--connection slave

# save  MTS submode
--let $saved_submode= `SELECT @@replica_parallel_type`
SET @saved_rpco= @@GLOBAL.replica_preserve_commit_order;
--source include/stop_slave.inc
SET GLOBAL replica_preserve_commit_order=OFF;

#setup 2 connections to master
--connect(m1, localhost,root,,,$MASTER_MYPORT)
--connect(m2, localhost,root,,,$MASTER_MYPORT)

--echo #setup the databases and tables
--connection m1
CREATE DATABASE db1;
CREATE TABLE db1.t (a int) engine=innodb;

--connection master
SET GLOBAL DEBUG ='-d,set_commit_parent_150';
SET GLOBAL DEBUG ='+d,set_commit_parent_100';

--connection m1
 INSERT INTO db1.t values (1),(2),(3);

# DEFAULT  ========> DATABASE
--connection slave
SET GLOBAL replica_parallel_type='DATABASE';
--source include/start_slave.inc
--connection master
--source include/sync_slave_sql_with_master.inc
--let diff_tables= master:db1.t,slave:db1.t
--source include/diff_tables.inc
--source include/stop_slave.inc

--connection master
SET GLOBAL DEBUG ='-d,set_commit_parent_100';
SET GLOBAL DEBUG ='+d,set_commit_parent_150';

--connection m1
 INSERT INTO db1.t values (1),(2),(3);

# DATABASE  ========> LOGICAL_CLOCK
--connection slave
SET GLOBAL replica_parallel_type='LOGICAL_CLOCK';
--source include/start_slave.inc
--connection master
--source include/sync_slave_sql_with_master.inc
--let diff_tables= master:db1.t,slave:db1.t
--source include/diff_tables.inc
--source include/stop_slave.inc

--connection master
SET GLOBAL DEBUG ='-d,set_commit_parent_150';
SET GLOBAL DEBUG ='+d,set_commit_parent_100';

--connection m1
 INSERT INTO db1.t values (1),(2),(3);

# LOGICAL_CLOCK  ========> DATABASE
--connection slave
SET GLOBAL replica_parallel_type='DATABASE';
--source include/start_slave.inc
--connection master
--source include/sync_slave_sql_with_master.inc
--let diff_tables= master:db1.t,slave:db1.t
--source include/diff_tables.inc


#clean up
--connection master
DROP DATABASE db1;
--source include/sync_slave_sql_with_master.inc

--connection slave

--source include/stop_slave.inc
--disable_query_log
--disable_result_log
--eval SET GLOBAL replica_parallel_type= '$saved_submode'
SET GLOBAL replica_preserve_commit_order=@saved_rpco;
--source include/start_slave.inc
--connection master
--eval SET GLOBAL DEBUG='$saved_debug'
--enable_query_log
--enable_result_log

--source include/rpl_end.inc