mirror of
https://github.com/MariaDB/server.git
synced 2025-10-24 16:38:14 +02:00
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>
121 lines
2.6 KiB
Text
121 lines
2.6 KiB
Text
connection node_2;
|
|
connection node_1;
|
|
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
|
connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
|
|
connection node_2;
|
|
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
|
connection node_4;
|
|
call mtr.add_suppression("WSREP: Ignoring server id .* for non bootstrap node");
|
|
connection node_3;
|
|
START SLAVE;
|
|
include/wait_for_slave_to_start.inc
|
|
connection node_1;
|
|
CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb;
|
|
SET AUTOCOMMIT=1;
|
|
INSERT INTO t1 VALUES (4000000, 'foobar');
|
|
SELECT COUNT(*) FROM t1;
|
|
COUNT(*)
|
|
50001
|
|
connection node_3;
|
|
connection node_1;
|
|
# node_1
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
connection node_2;
|
|
# node_2
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
connection node_3;
|
|
# node_3
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
connection node_4;
|
|
# node_4
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
connection node_1;
|
|
# node_1 insert new
|
|
INSERT INTO t1 values (5000000, 'foobar');
|
|
connection node_3;
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
connection node_2;
|
|
# node_2
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
connection node_3;
|
|
# node_3
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
connection node_4;
|
|
# node_4
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
SELECT * FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
connection node_2;
|
|
# node_3 different query same table
|
|
SELECT id, msg FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
connection node_4;
|
|
# node_6 different query same table
|
|
SELECT id, msg FROM t1 WHERE msg='foobar';
|
|
id msg
|
|
4000000 foobar
|
|
5000000 foobar
|
|
connection node_1;
|
|
drop table t1;
|
|
connection node_3;
|
|
connection node_3;
|
|
STOP SLAVE;
|
|
RESET SLAVE ALL;
|
|
Warnings:
|
|
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos'
|
|
connection node_1;
|
|
SET SESSION WSREP_ON=OFF;
|
|
include/kill_binlog_dump_threads.inc
|
|
RESET MASTER;
|
|
SET SESSION WSREP_ON=ON;
|
|
disconnect node_2;
|
|
disconnect node_1;
|
|
# End of test
|