Commit 634c654c authored by Sven Sandberg's avatar Sven Sandberg

BUG#11872422: rpl_slave_load_remove_tmpfile fails sporadically in pb2

Problem: the test failed because errors were found in the error log.
The test case contains suppressions for an old version of the error message,
but the format of the error message has changed without updating the suppression.
Fix: Update the suppression. Also small fixes to improve the test.
parent 10f5982e
include/master-slave.inc include/master-slave.inc
[connection master] [connection master]
SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write';
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb; create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
start transaction; start transaction;
insert into t1(b) values (1); insert into t1(b) values (1);
insert into t1(b) values (2); insert into t1(b) values (2);
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../../std_data/rpl_loaddata.dat' into table t1;
commit; commit;
include/wait_for_slave_sql_to_stop.inc include/wait_for_slave_sql_error.inc [errno=29, 13]
drop table t1; drop table t1;
include/sync_slave_io_with_master.inc include/sync_slave_io_with_master.inc
include/stop_slave_io.inc include/stop_slave_io.inc
...@@ -16,4 +17,5 @@ call mtr.add_suppression("Slave: Can't get stat of .*"); ...@@ -16,4 +17,5 @@ call mtr.add_suppression("Slave: Can't get stat of .*");
call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13");
call mtr.add_suppression("Slave: File.* not found.*"); call mtr.add_suppression("Slave: File.* not found.*");
call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29");
SET @@GLOBAL.DEBUG = '';
include/rpl_end.inc include/rpl_end.inc
--loose-debug=d,remove_slave_load_file_before_write
########################################################################## # ==== Purpose ====
#
# This test verifies if the slave fails gracefully when the temporary # This test verifies if the slave fails gracefully when the temporary
# file used to load data is removed while it is about to be used it. # file used to load data is removed while it is about to be used.
# Similar errors are caught if the temporary directory is removed. # Similar errors are caught if the temporary directory is removed.
# #
# ==== Implementation ====
#
# Steps: # Steps:
# 0 - Set debug variable remove_slave_load_file_before_write. This
# causes the slave to remove the file.
# 1 - Creates a table and populates it through "LOAD DATA INFILE". # 1 - Creates a table and populates it through "LOAD DATA INFILE".
# 2 - Catches error. # 2 - Catches error.
########################################################################## #
# ==== References ====
#
# BUG#42861: Assigning invalid directories to --slave-load-tmpdir crashes the slave
# BUG#11872422: rpl_slave_load_remove_tmpfile fails sporadically in pb2
--source include/have_binlog_format_statement.inc --source include/have_binlog_format_statement.inc
--source include/have_innodb.inc --source include/have_innodb.inc
...@@ -18,6 +27,11 @@ ...@@ -18,6 +27,11 @@
########################################################################## ##########################################################################
# Loading data # Loading data
########################################################################## ##########################################################################
connection slave;
--let $old_debug= `SELECT @@GLOBAL.DEBUG`
SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write';
connection master; connection master;
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb; create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
...@@ -32,19 +46,14 @@ commit; ...@@ -32,19 +46,14 @@ commit;
# Catch Error # Catch Error
########################################################################## ##########################################################################
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc;
--let $error= query_get_value(SHOW SLAVE STATUS, Last_Errno, 1)
# windows and linux different error numbers here: # windows and linux different error numbers here:
# Windows: # Windows:
# - Last_Errno 29 (File not found) # - Last_Errno 29 (File not found)
# Unix like OS: # Unix like OS:
# - Last_Errno 13 (Can't stat file) # - Last_Errno 13 (Can't stat file)
--let $assertion= `SELECT $error=29 OR $error=13` --let $slave_sql_errno= 29, 13
if (!$assertion) --source include/wait_for_slave_sql_error.inc
{
--echo UNEXPECTED ERROR NUMBER: $error
}
########################################################################## ##########################################################################
# Clean up # Clean up
...@@ -64,5 +73,8 @@ call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13") ...@@ -64,5 +73,8 @@ call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13")
call mtr.add_suppression("Slave: File.* not found.*"); call mtr.add_suppression("Slave: File.* not found.*");
call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29");
--let $rpl_only_running_threads= 1 --let $rpl_only_running_threads= 1
eval SET @@GLOBAL.DEBUG = '$old_debug';
--source include/rpl_end.inc --source include/rpl_end.inc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment