mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
f3314e90e3
Some errors that cause the slave SQL thread to stop are not shown in the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error is only in the server's error log. That makes it difficult to analyze the error for the user. One example of an error that stops the slave but is not shown by "SHOW SLAVE STATUS" is when @@global.init_slave is set incorrectly (e.g., it contains something that is not valid SQL). Three failures were not correctly reported: 1 - Failures during slave thread initialization 2 - Failures while initializing the relay log position right after starting the slave thread. 3 - Failures while processing queries passed through the init_slave option. This patch fixes the issues by reporting the errors through relay-info->report.
48 lines
1.1 KiB
Text
48 lines
1.1 KiB
Text
# Test for
|
|
# Bug #33931 assertion at write_ignored_events_info_to_relay_log if init_slave_thread() fails
|
|
# Bug #33932 assertion at handle_slave_sql if init_slave_thread() fails
|
|
|
|
source include/have_debug.inc;
|
|
source include/have_log_bin.inc;
|
|
|
|
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
|
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
|
|
|
|
|
connection master;
|
|
reset master;
|
|
|
|
connection slave;
|
|
|
|
# Add suppression for expected warnings in slaves error log
|
|
call mtr.add_suppression("Failed during slave thread initialization");
|
|
|
|
--disable_warnings
|
|
stop slave;
|
|
--enable_warnings
|
|
reset slave;
|
|
|
|
# Set debug flags on slave to force errors to occur
|
|
SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
|
|
|
|
start slave;
|
|
|
|
connection master;
|
|
save_master_pos;
|
|
connection slave;
|
|
|
|
#
|
|
# slave is going to stop because of emulated failures
|
|
# but there won't be any crashes nor asserts hit.
|
|
#
|
|
source include/wait_for_slave_to_stop.inc;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
--replace_column 1 # 8 # 9 # 19 # 23 # 33 # 37 #
|
|
query_vertical show slave status;
|
|
|
|
#
|
|
# Cleanup
|
|
#
|
|
SET GLOBAL debug="";
|
|
|