File: rpl_multi_source_channel_name_relay_log.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 (130 lines) | stat: -rw-r--r-- 4,591 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
--echo #########################################################################
--echo # Verify:
--echo #  Relay log file names are properly set for multisource replication
--echo #  In this tests we test if relay log files per channel based
--echo #  on --relay-log-index and --relay-log is properly set.
--echo # 1. The slave is started with --relay-log=msr-relay
--echo # 2. the slave is restarted with --relay-log-index=idx-msr-relay
--echo # 3. the slave is restarted with --relay-log-index=idx-msr-relay.idx
--echo #     and --relay-log=msr-relay.log
--echo #########################################################################

#Skip on group replication runs
--source include/not_group_replication_plugin.inc
--source include/have_binlog_format_row.inc
# Test requires master-info-repository=TABLE, relay-log-info-repository=TABLE
--source include/have_slave_repository_type_table.inc
--source include/master-slave.inc

--source include/rpl_connection_slave.inc
--let $datadir= `SELECT @@GLOBAL.datadir`

# add new channel
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "channel1";

--echo #
--echo # Check that the names of relay log files per channel are properly set
--echo #
#verify the index file and relay log file name of ch1 is properly set with
#channel name appended
FLUSH RELAY LOGS;
FLUSH RELAY LOGS FOR CHANNEL "channel1";

--let $relay_log_file_channel1=`SELECT CONCAT('$datadir','msr-relay-channel1.000001')`
--file_exists $relay_log_file_channel1

--let $relay_log_index_channel1= `SELECT CONCAT('$datadir', 'msr-relay-channel1.index')`
--file_exists $relay_log_index_channel1

--echo #
--echo # RESET SLAVE ALL for next test;
--echo #
--source include/rpl_stop_slaves.inc
RESET SLAVE ALL;

--echo #
--echo # 2. Shutdown server. Remove relay log files. Start server with
--echo #     --relay-log-index
--echo #
--let $rpl_server_number= 2
--source include/rpl_stop_server.inc

--remove_files_wildcard $datadir *msr-relay*

--let $rpl_server_number= 2
--let $rpl_server_parameters=--relay-log-index=idx-msr-relay
--source include/rpl_start_server.inc

# add new channel
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "channel1";

--echo #
--echo # Check that the names of relay log files per channel are properly set
--echo #
#verify the index file and relay log file name of ch1 and default is properly set with
FLUSH RELAY LOGS;
FLUSH RELAY LOGS FOR CHANNEL "channel1";

--let $relay_log_file_channel1=`SELECT CONCAT('$datadir','msr-relay-channel1.000001')`
--file_exists $relay_log_file_channel1

--let $relay_log_index_channel1= `SELECT CONCAT('$datadir', 'idx-msr-relay-channel1.index')`
--file_exists $relay_log_index_channel1

--echo #
--echo # RESET SLAVE ALL cleaningup.
--echo #
--source include/rpl_stop_slaves.inc
RESET SLAVE ALL;

--echo #
--echo # 3. Shutdown server. Remove relay log files. Start server with
--echo #    --relay-log-index and --relay-log with extensions.
--echo #    These extensions shall be stripped off
--let $rpl_server_number= 2
--source include/rpl_stop_server.inc

--remove_files_wildcard $datadir *msr-relay*

--let $rpl_server_number= 2
--let $rpl_server_parameters=--relay-log-index=idx-msr-relay.index1 --relay-log=msr-relay.log1
--source include/rpl_start_server.inc

# add new channel
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "channel1";

--echo #
--echo # Check that the names of relay log files per channel are properly set
--echo #
#verify the index file and relay log file name of ch1 and default is properly set with
FLUSH RELAY LOGS;
FLUSH RELAY LOGS FOR CHANNEL "channel1";

--let $relay_log_file_channel1=`SELECT CONCAT('$datadir','msr-relay-channel1.000001')`
--file_exists $relay_log_file_channel1

--let $relay_log_index_channel1= `SELECT CONCAT('$datadir', 'idx-msr-relay-channel1.index')`
--file_exists $relay_log_index_channel1

--echo #
--echo # RESET SLAVE ALL cleaningup.
--echo #
--source include/rpl_stop_slaves.inc
RESET SLAVE ALL;

--echo #
--echo # We have to reset the --relay-log and --relay-log-index options,
--echo # so that in the  next test case if the server restarts there is no mismatch
--echo # with the current options and the default option (i.e relay-log=slave-relay-bin)
--echo #
--source include/force_restart.inc

--disable_warnings
--replace_result $MASTER_MYPORT MYPORT
eval CHANGE REPLICATION SOURCE TO SOURCE_HOST="127.0.0.1", SOURCE_PORT=$MASTER_MYPORT,
          SOURCE_USER="root";
--enable_warnings

--source include/start_slave.inc
--source include/rpl_end.inc