Debian Codegraph @

mysql-test/suite/multi_source/info_logs.test

raw
1 #
2 # Check log files with multi-source
3 #
4
5 --source include/not_embedded.inc
6 --source include/binlog_start_pos.inc
7 --let $rpl_server_count= 0
8
9 --connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
10
11 --let $datadir = `SELECT @@datadir`
12
13 #
14 # Check creation and updating of multi-source *info* logs
15 #
16
17 --echo #
18 --echo # List of files matching '*info*' pattern before starting any slaves
19 --list_files $datadir *info*
20 --echo # End of list
21 --echo #
22 --echo # Contents of multi-master.info
23 --cat_file $datadir/multi-master.info
24 --echo # EOF
25 --echo #
26
27 # Start replication from the first master
28
29 --replace_result $SERVER_MYPORT_1 MYPORT_1
30 eval change master 'master1' to
31 master_port=$SERVER_MYPORT_1,
32 master_host='127.0.0.1',
33 master_user='root', master_ssl_verify_server_cert=0,
34 master_use_gtid=no;
35
36 start slave 'master1';
37 set default_master_connection = 'master1';
38 --source include/wait_for_slave_to_start.inc
39
40 # Check the files
41
42 --echo #
43 --echo # List of files matching '*info*' pattern while 'master1' is running
44 --list_files $datadir *info*
45 --echo # End of list
46 --echo #
47 --echo # Contents of multi-master.info
48 --cat_file $datadir/multi-master.info
49 --echo # EOF
50 --echo #
51
52 # Start replication from the second master
53
54 --replace_result $SERVER_MYPORT_2 MYPORT_2
55 eval change master 'MASTER 2.2' to
56 master_port=$SERVER_MYPORT_2,
57 master_host='127.0.0.1',
58 master_user='root', master_ssl_verify_server_cert=0,
59 master_use_gtid=no;
60
61 start slave 'MASTER 2.2';
62 set default_master_connection = 'MASTER 2.2';
63 --source include/wait_for_slave_to_start.inc
64
65 --connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
66 --save_master_pos
67
68 --connection slave
69 --sync_with_master 0,'MASTER 2.2'
70
71 # Check the files
72
73 --echo #
74 --echo # List of files matching '*info*' pattern
75 --echo # while 'master1' and 'MASTER 2.2' are running
76 --list_files $datadir *info*
77 --echo # End of list
78 --echo #
79 --echo # Contents of multi-master.info
80 --cat_file $datadir/multi-master.info
81 --echo # EOF
82 --echo #
83
84 # Remove master1 configuration
85
86 stop slave 'master1';
87 set default_master_connection = 'master1';
88 --source include/wait_for_slave_to_stop.inc
89 reset slave 'master1' all;
90
91 # Check the files
92
93 --echo #
94 --echo # List of files matching '*info*' pattern
95 --echo # after 'master1' was completely reset, 'MASTER 2.2' still running
96 --list_files $datadir *info*
97 --echo # End of list
98 --echo #
99 --echo # Contents of multi-master.info
100 --cat_file $datadir/multi-master.info
101 --echo # EOF
102 --echo #
103
104 # Start replication from the first master,
105 # now with the default empty name
106
107 set default_master_connection = '';
108 --replace_result $SERVER_MYPORT_1 MYPORT_1
109 eval change master to
110 master_port=$SERVER_MYPORT_1,
111 master_host='127.0.0.1',
112 master_user='root', master_ssl_verify_server_cert=0,
113 master_use_gtid=no;
114
115 start slave;
116 --source include/wait_for_slave_to_start.inc
117
118 --connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
119 --save_master_pos
120
121 --connection slave
122 --sync_with_master
123
124 # Check the files
125
126 --echo #
127 --echo # List of files matching '*info*' pattern
128 --echo # while 'MASTER 2.2' and '' are running
129 --list_files $datadir *info*
130 --echo # End of list
131 --echo #
132 --echo # Contents of multi-master.info
133 --cat_file $datadir/multi-master.info
134 --echo # EOF
135 --echo #
136
137 let $wait_for_all= 1;
138 let $show_statement= SHOW ALL SLAVES STATUS;
139 let $field= Slave_IO_State;
140 let $condition= = 'Waiting for master to send event';
141 --source include/wait_show_condition.inc
142
143 let read_master_log_pos=`select $binlog_start_pos + 73`;
144 let relay_log_pos=`select 2*$binlog_start_pos + 117`;
145 let relay_log_space1=`select 3*$binlog_start_pos + 160`;
146 let relay_log_space2=`select 3*$binlog_start_pos + 179`;
147 --replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
148 show all slaves status;
149
150 # Restart the slave server
151
152 --enable_reconnect
153 --append_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
154 restart
155 EOF
156 --shutdown_server
157 --source include/wait_until_connected_again.inc
158 --source include/wait_for_slave_to_start.inc
159 set default_master_connection = 'MASTER 2.2';
160 --source include/wait_for_slave_to_start.inc
161 set default_master_connection = '';
162
163 let $wait_for_all= 1;
164 let $show_statement= SHOW ALL SLAVES STATUS;
165 let $field= Slave_IO_State;
166 let $condition= = 'Waiting for master to send event';
167 --source include/wait_show_condition.inc
168
169
170 let relay_log_pos=`select 2*$binlog_start_pos + 44`;
171 let relay_log_space1=`select 3*$binlog_start_pos + 87`;
172 let relay_log_space2=`select 3*$binlog_start_pos + 106`;
173 --replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
174 show all slaves status;
175
176 # Check the files
177
178 --echo #
179 --echo # List of files matching '*info*' pattern
180 --echo # after slave server restart
181 --echo # while 'MASTER 2.2' and '' are running
182 --list_files $datadir *info*
183 --echo # End of list
184 --echo #
185 --echo # Contents of multi-master.info
186 --cat_file $datadir/multi-master.info
187 --echo # EOF
188 --echo #
189
190
191 # Cleanup
192
193 --source include/reset_master_slave.inc
194 --disconnect slave
195
196 --connection master1
197 --source include/reset_master_slave.inc
198 --disconnect master1
199
200 --connection master2
201 --source include/reset_master_slave.inc
202 --disconnect master2
203