1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00
Files
mariadb/mysql-test/include/test_fieldsize.inc
Kristian Nielsen 84da20e658 MDEV-34705: Binlog-in-engine: Protect against concurrent RESET MASTER and dump threads
This is actually an existing problem in the old binlog implementation, and
this patch is applicable to old binlog also. The problem is that RESET
MASTER can run concurrently with binlog dump threads / connected slaves.
This will remove the binlog from under the feet of the reader, which can
cause all sorts of strange behaviour.

This patch fixes the problem by disallowing to run RESET MASTER when dump
threads (or other RESET MASTER or SHOW BINARY LOGS) are running. An error is
thrown in this case, user must stop slaves and/or kill dump threads to make
the RESET MASTER go through. A slave that connects in the middle of RESET
MASTER will wait for it to complete.

Fix a lot of test cases to kill any lingering dump threads before doing
RESET MASTER, mostly just by sourcing include/kill_binlog_dump_threads.inc.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2025-07-23 16:19:50 +02:00

43 lines
864 B
PHP

#
# include/test_fieldsize.inc
#
# This include file is designed to create a table with one column
# whose size on the master is greater than that on the slave. The
# test should fail with an error on the slave.
#
connection master;
DROP TABLE IF EXISTS t1;
sync_slave_with_master;
STOP SLAVE;
--let $master_use_gtid_option= No
--source include/reset_slave.inc
eval $test_table_slave;
connection master;
eval $test_table_master;
--source include/kill_binlog_dump_threads.inc
RESET MASTER;
eval $test_insert;
connection slave;
START SLAVE;
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
# The following should be 0
SELECT COUNT(*) FROM t1;
STOP SLAVE;
--source include/reset_slave.inc
connection master;
--source include/kill_binlog_dump_threads.inc
RESET MASTER;
connection slave;
START SLAVE;