Commit 9b03041b authored by Elena Stepanova's avatar Elena Stepanova

Tests for Multi-source replication (MDEV-253)

parent 222883b0
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;
#
# 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
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;
#--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
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';
start slave 'slave1';
set default_master_connection = 'slave1';
include/wait_for_slave_to_start.inc
set default_master_connection = 'slave2';
start slave 'slave2';
include/wait_for_slave_to_start.inc
set default_master_connection = '';
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
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
eval change master 'slave2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';
start slave 'slave1';
set default_master_connection = 'slave1';
--source include/wait_for_slave_to_start.inc
set default_master_connection = '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
show full slave status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment