mirror of
https://github.com/MariaDB/server.git
synced 2025-08-26 01:44:06 +03:00
Problem 1: tests often fail in pushbuild with a timeout when waiting for the slave to start/stop/receive error. Fix 1: Updated the wait_for_slave_* macros in the following way: - The timeout is increased by a factor ten - Refactored the macros so that wait_for_slave_param does the work for the other macros. Problem 2: Tests are often incorrectly written, lacking a source include/wait_for_slave_to_[start|stop].inc. Fix 2: Improved the chance to get it right by adding include/start_slave.inc and include/stop_slave.inc, and updated tests to use these. Problem 3: The the built-in test language command wait_for_slave_to_stop is a misnomer (does not wait for the slave io thread) and does not give as much debug info in case of failure as the otherwise equivalent macro source include/wait_for_slave_sql_to_stop.inc Fix 3: Replaced all calls to the built-in command by a call to the macro. Problem 4: Some, but not all, of the wait_for_slave_* macros had an implicit connection slave. This made some tests confusing to read, and made it more difficult to use the macro in circular replication scenarios, where the connection named master needs to wait. Fix 4: Removed the implicit connection slave from all wait_for_slave_* macros, and updated tests to use an explicit connection slave where necessary. Problem 5: The macros wait_slave_status.inc and wait_show_pattern.inc were unused. Moreover, using them is difficult and error-prone. Fix 5: remove these macros. Problem 6: log_bin_trust_function_creators_basic failed when running tests because it assumed @@global.log_bin_trust_function_creators=1, and some tests modified this variable without resetting it to its original value. Fix 6: All tests that use this variable have been updated so that they reset the value at end of test.
33 lines
1014 B
Plaintext
33 lines
1014 B
Plaintext
-- source include/have_binlog_format_row.inc
|
|
-- source include/have_debug.inc
|
|
-- source include/master-slave.inc
|
|
|
|
# master is asked to create small Rows events: if only one event is
|
|
# created, stopping slave at the end of that one will show no bug, we
|
|
# need at least two (and stop after first); in this test we use three.
|
|
|
|
connection master;
|
|
create table t1 (words varchar(20)) engine=myisam;
|
|
|
|
load data infile '../../std_data/words.dat' into table t1 (words);
|
|
select count(*) from t1;
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
# slave will automatically stop the sql thread thanks to the .opt
|
|
# file; it will initiate the stop request after the first
|
|
# Rows_log_event (out of 3) but should wait until the last one is
|
|
# executed before stopping.
|
|
|
|
source include/wait_for_slave_sql_to_stop.inc;
|
|
|
|
# check that we inserted all rows (waited until the last Rows event)
|
|
select count(*) from t1;
|
|
|
|
connection master;
|
|
drop table t1;
|
|
connection slave; # slave SQL thread is stopped
|
|
source include/stop_slave.inc;
|
|
drop table t1;
|