~ubuntu-branches/ubuntu/wily/mysql-5.6/wily

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_parallel_change_master.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2015-07-21 07:09:29 UTC
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20150721070929-mg4dpqkgg3it1ajf
Tags: upstream-5.6.25
ImportĀ upstreamĀ versionĀ 5.6.25

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
--connection slave
16
16
call mtr.add_suppression("Slave SQL: .*Could not execute Write_rows event on table d1.t1; Duplicate entry '13' for key 'a'");
17
17
call mtr.add_suppression("Slave SQL: ... The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.");
 
18
call mtr.add_suppression("Error writing relay log configuration.");
18
19
--source include/stop_slave.inc
19
20
SET @save.slave_parallel_workers=@@global.slave_parallel_workers;
20
21
SET @@global.slave_parallel_workers=2;
132
133
DROP DATABASE d2;
133
134
--source include/sync_slave_sql_with_master.inc
134
135
 
 
136
###############################################################################
 
137
# Bug#20411374: CAN NOT EXECUTE CHANGE MASTER AFTER ERROR OCCURED IN MTS MODE
 
138
#
 
139
# Problem:
 
140
# ========
 
141
# When error occurred in MTS mode, If user first change master
 
142
# (ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS received here), and then reset slave,
 
143
# user can never change master (error ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS
 
144
# occurred again). The debug version mysqld will crash at this case.
 
145
#
 
146
# Test:
 
147
# =====
 
148
# Generate MTS gaps and execute CHANGE MASTER command so that
 
149
# ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS error is reported. Execute RESET
 
150
# SLAVE command. Reexecute the CHANGE MASTER command once again it should
 
151
# report an assert in the case of bug scenario and it should succeed after the
 
152
# fix.
 
153
###############################################################################
 
154
--source include/rpl_connection_slave.inc
 
155
--source include/stop_slave.inc
 
156
SET @save.slave_parallel_workers=@@global.slave_parallel_workers;
 
157
SET @@global.slave_parallel_workers=2;
 
158
SET @save.relay_log_info_repository=@@global.relay_log_info_repository;
 
159
SET @@global.relay_log_info_repository='TABLE';
 
160
--source include/start_slave.inc
 
161
 
 
162
--source include/rpl_connection_master.inc
 
163
CREATE DATABASE d1;
 
164
CREATE DATABASE d2;
 
165
CREATE TABLE d1.t1 (a int unique) ENGINE=INNODB;
 
166
CREATE TABLE d2.t1 (a int unique) ENGINE=INNODB;
 
167
--source include/sync_slave_sql_with_master.inc
 
168
BEGIN;
 
169
INSERT INTO d1.t1 VALUES (13); # to cause the dup key error
 
170
# change-master with gaps
 
171
--source include/rpl_connection_master.inc
 
172
INSERT INTO d1.t1 VALUES (6);
 
173
INSERT INTO d2.t1 VALUES (7);
 
174
INSERT INTO d1.t1 VALUES (13);
 
175
INSERT INTO d2.t1 VALUES (8);  # this worker will race over one inserting (13)
 
176
INSERT INTO d2.t1 VALUES (9);
 
177
 
 
178
--source include/rpl_connection_slave1.inc
 
179
# make sure workers doing d2.t1 raced the one that occupied  with d1.t1
 
180
--let $count= 1
 
181
--let $table= d2.t1
 
182
--let $wait_condition= select count(*) = 1 from $table where a = 8
 
183
--source include/wait_condition.inc
 
184
 
 
185
--source include/rpl_connection_slave.inc
 
186
# make worker executing (13) to error out
 
187
COMMIT;
 
188
 
 
189
--let $slave_sql_errno= 1062
 
190
--source include/wait_for_slave_sql_error.inc
 
191
 
 
192
--source include/stop_slave_io.inc
 
193
 
 
194
--source include/rpl_connection_master.inc
 
195
FLUSH LOGS;
 
196
--let $file= query_get_value(SHOW MASTER STATUS, File, 1)
 
197
--let $pos= query_get_value(SHOW MASTER STATUS, Position, 1)
 
198
 
 
199
--source include/rpl_connection_slave.inc
 
200
--replace_result $MASTER_MYPORT MASTER_PORT  $file FILE $pos POS
 
201
--replace_column 2 ####
 
202
--error ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS
 
203
eval CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= $MASTER_MYPORT, MASTER_USER= 'root',MASTER_LOG_FILE = '$file', MASTER_LOG_POS = $pos ;
 
204
reset slave;
 
205
--replace_result $MASTER_MYPORT MASTER_PORT  $file FILE $pos POS
 
206
--replace_column 2 ####
 
207
eval CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= $MASTER_MYPORT, MASTER_USER= 'root',MASTER_LOG_FILE = '$file', MASTER_LOG_POS = $pos ;
 
208
 
 
209
SET @@global.slave_parallel_workers= @save.slave_parallel_workers;
 
210
SET @@global.relay_log_info_repository= @save.relay_log_info_repository;
 
211
--source include/start_slave.inc
 
212
#
 
213
# cleanup
 
214
#
 
215
--source include/rpl_connection_master.inc
 
216
DROP DATABASE d1;
 
217
DROP DATABASE d2;
 
218
 
135
219
--source include/rpl_end.inc