mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Tests for Multi-source replication (MDEV-253)
This commit is contained in:
27
mysql-test/suite/multi_source/relaylog_events.result
Normal file
27
mysql-test/suite/multi_source/relaylog_events.result
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
change master 'master1' to
|
||||||
|
master_port=MYPORT_1,
|
||||||
|
master_host='127.0.0.1',
|
||||||
|
master_user='root';
|
||||||
|
start slave 'master1';
|
||||||
|
set default_master_connection = 'master1';
|
||||||
|
include/wait_for_slave_to_start.inc
|
||||||
|
drop table if exists t1;
|
||||||
|
create table t1 (i int) engine=MyISAM;
|
||||||
|
mysqld-relay-bin-master1.000001
|
||||||
|
mysqld-relay-bin-master1.000002
|
||||||
|
show relaylog events in 'mysqld-relay-bin-master1.000002';
|
||||||
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
|
mysqld-relay-bin-master1.000002 4 Format_desc 3 246 Server version
|
||||||
|
mysqld-relay-bin-master1.000002 246 Rotate 1 0 master-bin.000001;pos=4
|
||||||
|
mysqld-relay-bin-master1.000002 290 Format_desc 1 246 Server version
|
||||||
|
mysqld-relay-bin-master1.000002 532 Binlog_checkpoint 1 286 master-bin.000001
|
||||||
|
mysqld-relay-bin-master1.000002 572 Query 1 400 use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
|
||||||
|
mysqld-relay-bin-master1.000002 686 Query 1 500 use `test`; create table t1 (i int) engine=MyISAM
|
||||||
|
show relaylog events;
|
||||||
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
|
mysqld-relay-bin-master1.000001 4 Format_desc 3 246 Server version
|
||||||
|
mysqld-relay-bin-master1.000001 246 Rotate 3 304 mysqld-relay-bin-master1.000002;pos=4
|
||||||
|
drop table t1;
|
||||||
|
stop slave;
|
||||||
|
include/wait_for_slave_to_stop.inc
|
||||||
|
reset master;
|
50
mysql-test/suite/multi_source/relaylog_events.test
Normal file
50
mysql-test/suite/multi_source/relaylog_events.test
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
# Check that SHOW RELAYLOG EVENTS can be used
|
||||||
|
# for a named master connection
|
||||||
|
#
|
||||||
|
|
||||||
|
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
|
||||||
|
|
||||||
|
--replace_result $SERVER_MYPORT_1 MYPORT_1
|
||||||
|
eval change master 'master1' to
|
||||||
|
master_port=$SERVER_MYPORT_1,
|
||||||
|
master_host='127.0.0.1',
|
||||||
|
master_user='root';
|
||||||
|
|
||||||
|
start slave 'master1';
|
||||||
|
set default_master_connection = 'master1';
|
||||||
|
--source include/wait_for_slave_to_start.inc
|
||||||
|
|
||||||
|
--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
|
||||||
|
--disable_warnings
|
||||||
|
drop table if exists t1;
|
||||||
|
--enable_warnings
|
||||||
|
create table t1 (i int) engine=MyISAM;
|
||||||
|
--save_master_pos
|
||||||
|
|
||||||
|
--connection slave
|
||||||
|
--sync_with_master 0,'master1'
|
||||||
|
|
||||||
|
--let $datadir = `SELECT @@datadir`
|
||||||
|
--list_files $datadir mysqld-relay-bin-master1.*
|
||||||
|
|
||||||
|
--replace_regex /Server ver:.*/Server version/
|
||||||
|
show relaylog events in 'mysqld-relay-bin-master1.000002';
|
||||||
|
--replace_regex /Server ver:.*/Server version/
|
||||||
|
show relaylog events;
|
||||||
|
|
||||||
|
--connection master1
|
||||||
|
drop table t1;
|
||||||
|
--save_master_pos
|
||||||
|
|
||||||
|
--connection slave
|
||||||
|
--sync_with_master 0,'master1'
|
||||||
|
stop slave;
|
||||||
|
--source include/wait_for_slave_to_stop.inc
|
||||||
|
|
||||||
|
--disconnect slave
|
||||||
|
|
||||||
|
--connection master1
|
||||||
|
reset master;
|
||||||
|
--disconnect master1
|
||||||
|
|
31
mysql-test/suite/multi_source/reset_slave.result
Normal file
31
mysql-test/suite/multi_source/reset_slave.result
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
change master 'master1' to
|
||||||
|
master_port=MYPORT_1,
|
||||||
|
master_host='127.0.0.1',
|
||||||
|
master_user='root';
|
||||||
|
start slave 'master1';
|
||||||
|
set default_master_connection = 'master1';
|
||||||
|
include/wait_for_slave_to_start.inc
|
||||||
|
drop table if exists t1;
|
||||||
|
create table t1 (i int) engine=MyISAM;
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
stop slave 'master1';
|
||||||
|
show slave 'master1' status;
|
||||||
|
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
|
||||||
|
127.0.0.1 root MYPORT_1 60 master-bin.000001 729 mysqld-relay-bin-master1.000002 1015 master-bin.000001 No No 0 0 729 1319 None 0 No NULL No 0 0 1
|
||||||
|
mysqld-relay-bin-master1.000001
|
||||||
|
mysqld-relay-bin-master1.000002
|
||||||
|
mysqld-relay-bin.index-master1
|
||||||
|
reset slave 'master1';
|
||||||
|
show slave 'master1' status;
|
||||||
|
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
|
||||||
|
127.0.0.1 root MYPORT_1 60 4 mysqld-relay-bin-master1.000001 4 No No 0 0 0 265 None 0 No NULL No 0 0 1
|
||||||
|
mysqld-relay-bin-master1.000001
|
||||||
|
mysqld-relay-bin.index-master1
|
||||||
|
reset slave 'master1' all;
|
||||||
|
show slave 'master1' status;
|
||||||
|
ERROR HY000: There is no master connection 'master1'
|
||||||
|
mysqld-relay-bin-master1.000001
|
||||||
|
mysqld-relay-bin.index-master1
|
||||||
|
drop table t1;
|
||||||
|
drop table t1;
|
||||||
|
reset master;
|
62
mysql-test/suite/multi_source/reset_slave.test
Normal file
62
mysql-test/suite/multi_source/reset_slave.test
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#--enable_connect_log
|
||||||
|
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
|
||||||
|
|
||||||
|
--replace_result $SERVER_MYPORT_1 MYPORT_1
|
||||||
|
eval change master 'master1' to
|
||||||
|
master_port=$SERVER_MYPORT_1,
|
||||||
|
master_host='127.0.0.1',
|
||||||
|
master_user='root';
|
||||||
|
|
||||||
|
start slave 'master1';
|
||||||
|
|
||||||
|
set default_master_connection = 'master1';
|
||||||
|
--source include/wait_for_slave_to_start.inc
|
||||||
|
|
||||||
|
--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
drop table if exists t1;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
create table t1 (i int) engine=MyISAM;
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
|
||||||
|
--save_master_pos
|
||||||
|
|
||||||
|
--connection slave
|
||||||
|
|
||||||
|
--sync_with_master 0,'master1'
|
||||||
|
stop slave 'master1';
|
||||||
|
|
||||||
|
--wait_for_slave_to_stop
|
||||||
|
|
||||||
|
--let $datadir = `SELECT @@datadir`
|
||||||
|
|
||||||
|
--replace_result $SERVER_MYPORT_1 MYPORT_1
|
||||||
|
show slave 'master1' status;
|
||||||
|
--list_files $datadir mysqld*
|
||||||
|
|
||||||
|
reset slave 'master1';
|
||||||
|
|
||||||
|
--replace_result $SERVER_MYPORT_1 MYPORT_1
|
||||||
|
show slave 'master1' status;
|
||||||
|
--list_files $datadir mysqld*
|
||||||
|
|
||||||
|
reset slave 'master1' all;
|
||||||
|
|
||||||
|
--error WARN_NO_MASTER_INFO
|
||||||
|
show slave 'master1' status;
|
||||||
|
--list_files $datadir mysqld*
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
--disconnect slave
|
||||||
|
|
||||||
|
--connection master1
|
||||||
|
drop table t1;
|
||||||
|
reset master;
|
||||||
|
--disconnect master1
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
|||||||
change master 'slave1' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
|
change master 'slave1' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
|
||||||
change master 'slave2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
|
change master 'slave2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
|
||||||
start slave 'slave1';
|
start slave 'slave1';
|
||||||
|
set default_master_connection = 'slave1';
|
||||||
|
include/wait_for_slave_to_start.inc
|
||||||
|
set default_master_connection = 'slave2';
|
||||||
start slave 'slave2';
|
start slave 'slave2';
|
||||||
|
include/wait_for_slave_to_start.inc
|
||||||
|
set default_master_connection = '';
|
||||||
show full slave status;
|
show full slave status;
|
||||||
Connection_name Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
|
Connection_name Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
|
||||||
slave1 Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 mysqld-relay-bin-slave1.000002 572 master-bin.000001 Yes Yes 0 0 286 875 None 0 No 0 No 0 0 1
|
slave1 Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 mysqld-relay-bin-slave1.000002 572 master-bin.000001 Yes Yes 0 0 286 875 None 0 No 0 No 0 0 1
|
||||||
|
@ -9,8 +9,12 @@ eval change master 'slave1' to master_port=$SERVER_MYPORT_1, master_host='127.0.
|
|||||||
--replace_result $SERVER_MYPORT_2 MYPORT_2
|
--replace_result $SERVER_MYPORT_2 MYPORT_2
|
||||||
eval change master 'slave2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';
|
eval change master 'slave2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';
|
||||||
start slave 'slave1';
|
start slave 'slave1';
|
||||||
|
set default_master_connection = 'slave1';
|
||||||
|
--source include/wait_for_slave_to_start.inc
|
||||||
|
set default_master_connection = 'slave2';
|
||||||
start slave 'slave2';
|
start slave 'slave2';
|
||||||
--sleep 5
|
--source include/wait_for_slave_to_start.inc
|
||||||
|
set default_master_connection = '';
|
||||||
|
|
||||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
|
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
|
||||||
show full slave status;
|
show full slave status;
|
||||||
|
Reference in New Issue
Block a user