summaryrefslogtreecommitdiff
path: root/mysql-test/suite/multi_source/info_logs.test
blob: 4e9a4028b9358c23d9bda3b7200df08cc47c58e1 (plain)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#
# Check log files with multi-source
#

--source include/not_embedded.inc
--let $rpl_server_count= 0

--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)

--let $datadir = `SELECT @@datadir`

#
# Check creation and updating of multi-source *info* logs
#

--echo #
--echo # List of files matching '*info*' pattern before starting any slaves
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #

# Start replication from the first master

--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
master_user='root';

start slave 'master1';
set default_master_connection = 'master1';
--source include/wait_for_slave_to_start.inc

# Check the files

--echo #
--echo # List of files matching '*info*' pattern while 'master1' is running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #

# Start replication from the second master

--replace_result $SERVER_MYPORT_2 MYPORT_2
eval change master 'MASTER 2.2' to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
master_user='root';

start slave 'MASTER 2.2';
set default_master_connection = 'MASTER 2.2';
--source include/wait_for_slave_to_start.inc

--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
--save_master_pos

--connection slave
--sync_with_master 0,'MASTER 2.2'

# Check the files

--echo #
--echo # List of files matching '*info*' pattern
--echo #  while 'master1' and 'MASTER 2.2' are running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #

# Remove master1 configuration

stop slave 'master1';
set default_master_connection = 'master1';
--source include/wait_for_slave_to_stop.inc
reset slave 'master1' all;

# Check the files

--echo #
--echo # List of files matching '*info*' pattern
--echo #  after 'master1' was completely reset, 'MASTER 2.2' still running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #

# Start replication from the first master,
# now with the default empty name

set default_master_connection = '';
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
master_user='root';

start slave;
--source include/wait_for_slave_to_start.inc

--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
--save_master_pos

--connection slave
--sync_with_master

# Check the files

--echo #
--echo # List of files matching '*info*' pattern
--echo #   while 'MASTER 2.2' and '' are running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #

--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
show all slaves status;

# Restart the slave server

--enable_reconnect
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
restart
EOF
--shutdown_server 60
--source include/wait_until_connected_again.inc
--source include/wait_for_slave_to_start.inc
set default_master_connection = 'MASTER 2.2';
--source include/wait_for_slave_to_start.inc
set default_master_connection = '';

--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
show all slaves status;

# Check the files

--echo #
--echo # List of files matching '*info*' pattern
--echo #   after slave server restart
--echo #   while 'MASTER 2.2' and '' are running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #


# Cleanup

--source reset_master_slave.inc
--disconnect slave

--connection master1
--source reset_master_slave.inc
--disconnect master1

--connection master2
--source reset_master_slave.inc
--disconnect master2