mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-5769: Slave crashes on attempt to do parallel replication from an older master
Older master has no GTID events, so such events are not available for deciding on scheduling of event groups and so on. With this patch, we run such events from old masters single-threaded, in the sql driver thread. This seems better than trying to make the parallel code handle the data from older masters; while possible, this would require a lot of testing (as well as possibly some extra overhead in the scheduling of events), which hardly seems worthwhile.
This commit is contained in:
BIN
mysql-test/std_data/mariadb-5.5-binlog.000001
Normal file
BIN
mysql-test/std_data/mariadb-5.5-binlog.000001
Normal file
Binary file not shown.
27
mysql-test/suite/rpl/r/rpl_old_master.result
Normal file
27
mysql-test/suite/rpl/r/rpl_old_master.result
Normal file
@ -0,0 +1,27 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
include/stop_slave.inc
|
||||
include/rpl_stop_server.inc [server_number=1]
|
||||
include/rpl_start_server.inc [server_number=1]
|
||||
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4;
|
||||
include/start_slave.inc
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 4
|
||||
4 8
|
||||
5 16
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
1
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=@old_parallel;
|
||||
DROP TABLE t1;
|
||||
include/start_slave.inc
|
||||
DROP TABLE t2;
|
||||
include/rpl_end.inc
|
49
mysql-test/suite/rpl/t/rpl_old_master.test
Normal file
49
mysql-test/suite/rpl/t/rpl_old_master.test
Normal file
@ -0,0 +1,49 @@
|
||||
# Test replicating off old master.
|
||||
# We simulate old master by copying in pre-generated binlog files from earlier
|
||||
# server versions.
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection master
|
||||
--let $datadir= `SELECT @@datadir`
|
||||
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_stop_server.inc
|
||||
|
||||
--remove_file $datadir/master-bin.000001
|
||||
--copy_file $MYSQL_TEST_DIR/std_data/mariadb-5.5-binlog.000001 $datadir/master-bin.000001
|
||||
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_start_server.inc
|
||||
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
--connection slave
|
||||
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
|
||||
eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
--save_master_pos
|
||||
|
||||
--connection slave
|
||||
--sync_with_master
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SELECT * FROM t2;
|
||||
|
||||
--source include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=@old_parallel;
|
||||
DROP TABLE t1;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t2;
|
||||
--source include/rpl_end.inc
|
Reference in New Issue
Block a user