mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
test cleanup: remove Format_description_log_event size dependency
1. use include/show_binlog_events.inc instead of SHOW BINLOG EVENTS 2. use include/show_relaylog_eventc.inc too 3. in all other places where a number might appear in the result file, include binlog_start_pos.inc, calculate the position like pos=`select $binlog_start_pos + 100`; and use replace_result $pos <pos>
This commit is contained in:
@ -85,16 +85,16 @@ MASTER 2.2
|
||||
#
|
||||
show all slaves status;
|
||||
Connection_name Slave_SQL_State 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 Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
|
||||
Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 relay.000002 601 master-bin.000001 Yes Yes 0 0 313 888 None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
|
||||
MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 relay-master@00202@002e2.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
|
||||
MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = 'MASTER 2.2';
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
show all slaves status;
|
||||
Connection_name Slave_SQL_State 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 Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
|
||||
Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 relay.000004 536 master-bin.000001 Yes Yes 0 0 313 823 None 0 No 0 No 0 0 1 No conservative 0 1073741824 6 0 60.000
|
||||
MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 relay-master@00202@002e2.000004 536 master-bin.000001 Yes Yes 0 0 313 842 None 0 No 0 No 0 0 2 No conservative 0 1073741824 6 0 60.000
|
||||
Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 6 0 60.000
|
||||
MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 No 0 No 0 0 2 No conservative 0 1073741824 6 0 60.000
|
||||
#
|
||||
# List of files matching '*info*' pattern
|
||||
# after slave server restart
|
||||
|
@ -3,6 +3,7 @@
|
||||
#
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/binlog_start_pos.inc
|
||||
--let $rpl_server_count= 0
|
||||
|
||||
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
|
||||
@ -136,8 +137,11 @@ let $field= Slave_IO_State;
|
||||
let $condition= = 'Waiting for master to send event';
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
|
||||
let read_master_log_pos=`select $binlog_start_pos + 65`;
|
||||
let relay_log_pos=`select 2*$binlog_start_pos + 105`;
|
||||
let relay_log_space1=`select 3*$binlog_start_pos + 144`;
|
||||
let relay_log_space2=`select 3*$binlog_start_pos + 163`;
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
|
||||
show all slaves status;
|
||||
|
||||
# Restart the slave server
|
||||
@ -160,7 +164,10 @@ let $condition= = 'Waiting for master to send event';
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
|
||||
let relay_log_pos=`select 2*$binlog_start_pos + 40`;
|
||||
let relay_log_space1=`select 3*$binlog_start_pos + 79`;
|
||||
let relay_log_space2=`select 3*$binlog_start_pos + 98`;
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
|
||||
show all slaves status;
|
||||
|
||||
# Check the files
|
||||
|
@ -52,27 +52,27 @@ i f1
|
||||
mysqld-relay-bin-master1.000001
|
||||
mysqld-relay-bin-master1.000002
|
||||
mysqld-relay-bin-master1.index
|
||||
show relaylog events;
|
||||
include/show_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-relay-bin-master1.000001 4 Format_desc 3 248 Server version
|
||||
mysqld-relay-bin-master1.000001 248 Rotate 3 306 mysqld-relay-bin-master1.000002;pos=4
|
||||
show relaylog events in 'mysqld-relay-bin-master1.000002';
|
||||
mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4
|
||||
include/show_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-relay-bin-master1.000002 4 Format_desc 3 248 Server version
|
||||
mysqld-relay-bin-master1.000002 248 Rotate 1 0 master-bin.000001;pos=4
|
||||
mysqld-relay-bin-master1.000002 292 Format_desc 1 248 Server version
|
||||
mysqld-relay-bin-master1.000002 536 Gtid_list 1 273 []
|
||||
mysqld-relay-bin-master1.000002 561 Binlog_checkpoint 1 313 master-bin.000001
|
||||
mysqld-relay-bin-master1.000002 601 Gtid 1 351 GTID 0-1-1
|
||||
mysqld-relay-bin-master1.000002 639 Query 1 440 drop database if exists db1
|
||||
mysqld-relay-bin-master1.000002 728 Gtid 1 478 GTID 0-1-2
|
||||
mysqld-relay-bin-master1.000002 766 Query 1 559 create database db1
|
||||
mysqld-relay-bin-master1.000002 847 Gtid 1 597 GTID 0-1-3
|
||||
mysqld-relay-bin-master1.000002 885 Query 1 750 use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM
|
||||
mysqld-relay-bin-master1.000002 1038 Gtid 1 788 BEGIN GTID 0-1-4
|
||||
mysqld-relay-bin-master1.000002 1076 Intvar 1 816 INSERT_ID=1
|
||||
mysqld-relay-bin-master1.000002 1104 Query 1 920 use `db1`; insert into t1 (f1) values ('one'),('two')
|
||||
mysqld-relay-bin-master1.000002 1208 Query 1 988 COMMIT
|
||||
mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin-master1.000002 # Rotate # # master-bin.000001;pos=POS
|
||||
mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin-master1.000002 # Gtid_list # # []
|
||||
mysqld-relay-bin-master1.000002 # Binlog_checkpoint # # master-bin.000001
|
||||
mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
|
||||
mysqld-relay-bin-master1.000002 # Query # # drop database if exists db1
|
||||
mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
|
||||
mysqld-relay-bin-master1.000002 # Query # # create database db1
|
||||
mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
|
||||
mysqld-relay-bin-master1.000002 # Query # # use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM
|
||||
mysqld-relay-bin-master1.000002 # Gtid # # BEGIN GTID #-#-#
|
||||
mysqld-relay-bin-master1.000002 # Intvar # # INSERT_ID=1
|
||||
mysqld-relay-bin-master1.000002 # Query # # use `db1`; insert into t1 (f1) values ('one'),('two')
|
||||
mysqld-relay-bin-master1.000002 # Query # # COMMIT
|
||||
change master 'master1' to
|
||||
master_port=MYPORT_2,
|
||||
master_host='127.0.0.1',
|
||||
@ -138,7 +138,7 @@ flush logs;
|
||||
purge binary logs to 'master-bin.000002';
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin.000002 367
|
||||
master-bin.000002 filesize
|
||||
insert into t1 (f1) values ('four');
|
||||
create table db1.t3 (f1 int) engine=InnoDB;
|
||||
#
|
||||
@ -167,27 +167,27 @@ i f1
|
||||
2 two
|
||||
3 three
|
||||
4 four
|
||||
show relaylog events;
|
||||
include/show_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-relay-bin.000001 4 Format_desc 3 248 Server version
|
||||
mysqld-relay-bin.000001 248 Rotate 3 298 mysqld-relay-bin.000002;pos=4
|
||||
show relaylog events in 'mysqld-relay-bin.000002';
|
||||
mysqld-relay-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin.000001 # Rotate # # mysqld-relay-bin.000002;pos=4
|
||||
include/show_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-relay-bin.000002 4 Format_desc 3 248 Server version
|
||||
mysqld-relay-bin.000002 248 Rotate 2 0 master-bin.000001;pos=4
|
||||
mysqld-relay-bin.000002 292 Format_desc 2 248 Server version
|
||||
mysqld-relay-bin.000002 536 Gtid_list 2 273 []
|
||||
mysqld-relay-bin.000002 561 Binlog_checkpoint 2 313 master-bin.000001
|
||||
mysqld-relay-bin.000002 601 Gtid 2 351 GTID 0-2-1
|
||||
mysqld-relay-bin.000002 639 Query 2 440 drop database if exists db2
|
||||
mysqld-relay-bin.000002 728 Gtid 2 478 GTID 0-2-2
|
||||
mysqld-relay-bin.000002 766 Query 2 559 create database db2
|
||||
mysqld-relay-bin.000002 847 Gtid 2 597 GTID 0-2-3
|
||||
mysqld-relay-bin.000002 885 Query 2 732 use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB
|
||||
mysqld-relay-bin.000002 1020 Gtid 2 770 BEGIN GTID 0-2-4
|
||||
mysqld-relay-bin.000002 1058 Intvar 2 798 INSERT_ID=1
|
||||
mysqld-relay-bin.000002 1086 Query 2 894 use `db2`; insert into t1 (f1) values (1),(2)
|
||||
mysqld-relay-bin.000002 1182 Xid 2 921 COMMIT /* xid=<num> */
|
||||
mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
|
||||
mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin.000002 # Gtid_list # # []
|
||||
mysqld-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
|
||||
mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
|
||||
mysqld-relay-bin.000002 # Query # # drop database if exists db2
|
||||
mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
|
||||
mysqld-relay-bin.000002 # Query # # create database db2
|
||||
mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
|
||||
mysqld-relay-bin.000002 # Query # # use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB
|
||||
mysqld-relay-bin.000002 # Gtid # # BEGIN GTID #-#-#
|
||||
mysqld-relay-bin.000002 # Intvar # # INSERT_ID=1
|
||||
mysqld-relay-bin.000002 # Query # # use `db2`; insert into t1 (f1) values (1),(2)
|
||||
mysqld-relay-bin.000002 # Xid # # COMMIT /* XID */
|
||||
stop slave io_thread;
|
||||
show status like 'Slave_running';
|
||||
Variable_name Value
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/binlog_start_pos.inc
|
||||
--let $rpl_server_count= 0
|
||||
|
||||
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
|
||||
@ -99,11 +100,11 @@ select * from db1.t1;
|
||||
|
||||
# Check that relay logs are recognizable
|
||||
|
||||
--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/
|
||||
show relaylog events;
|
||||
--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/
|
||||
show relaylog events in 'mysqld-relay-bin-master1.000002';
|
||||
|
||||
let binlog_start=4;
|
||||
let binlog_file=;
|
||||
source include/show_relaylog_events.inc;
|
||||
let binlog_file= mysqld-relay-bin-master1.000002;
|
||||
source include/show_relaylog_events.inc;
|
||||
|
||||
# Try to configure connection with the same name again,
|
||||
# should get an error because the slave is running
|
||||
@ -221,6 +222,8 @@ flush logs;
|
||||
|
||||
--connection master1
|
||||
purge binary logs to 'master-bin.000002';
|
||||
let filesize=`select $binlog_start_pos+119`;
|
||||
--replace_result $filesize filesize
|
||||
show binary logs;
|
||||
insert into t1 (f1) values ('four');
|
||||
create table db1.t3 (f1 int) engine=InnoDB;
|
||||
@ -252,10 +255,10 @@ select * from db1.t1;
|
||||
|
||||
# This should show relay log events for the default master
|
||||
# (the one with the empty name)
|
||||
--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/
|
||||
show relaylog events;
|
||||
--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/
|
||||
show relaylog events in 'mysqld-relay-bin.000002';
|
||||
let binlog_file=;
|
||||
source include/show_relaylog_events.inc;
|
||||
let binlog_file= mysqld-relay-bin.000002;
|
||||
source include/show_relaylog_events.inc;
|
||||
|
||||
# Make sure we don't lose control over replication connections
|
||||
# after reconnecting to the slave
|
||||
|
@ -17,6 +17,7 @@ server-id=3
|
||||
log-warnings=2
|
||||
|
||||
[ENV]
|
||||
MASTER_MYPORT= @mysqld.1.port
|
||||
SERVER_MYPORT_1= @mysqld.1.port
|
||||
SERVER_MYSOCK_1= @mysqld.1.socket
|
||||
SERVER_MYPORT_2= @mysqld.2.port
|
||||
|
@ -10,21 +10,21 @@ create table t1 (i int) engine=MyISAM;
|
||||
mysqld-relay-bin-master1.000001
|
||||
mysqld-relay-bin-master1.000002
|
||||
mysqld-relay-bin-master1.index
|
||||
show relaylog events in 'mysqld-relay-bin-master1.000002';
|
||||
include/show_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-relay-bin-master1.000002 4 Format_desc 3 248 Server version
|
||||
mysqld-relay-bin-master1.000002 248 Rotate 1 0 master-bin.000001;pos=4
|
||||
mysqld-relay-bin-master1.000002 292 Format_desc 1 248 Server version
|
||||
mysqld-relay-bin-master1.000002 536 Gtid_list 1 273 []
|
||||
mysqld-relay-bin-master1.000002 561 Binlog_checkpoint 1 313 master-bin.000001
|
||||
mysqld-relay-bin-master1.000002 601 Gtid 1 351 GTID 0-1-1
|
||||
mysqld-relay-bin-master1.000002 639 Query 1 465 use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
|
||||
mysqld-relay-bin-master1.000002 753 Gtid 1 503 GTID 0-1-2
|
||||
mysqld-relay-bin-master1.000002 791 Query 1 603 use `test`; create table t1 (i int) engine=MyISAM
|
||||
show relaylog events;
|
||||
mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin-master1.000002 # Rotate # # master-bin.000001;pos=POS
|
||||
mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin-master1.000002 # Gtid_list # # []
|
||||
mysqld-relay-bin-master1.000002 # Binlog_checkpoint # # master-bin.000001
|
||||
mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
|
||||
mysqld-relay-bin-master1.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
|
||||
mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
|
||||
mysqld-relay-bin-master1.000002 # Query # # use `test`; create table t1 (i int) engine=MyISAM
|
||||
include/show_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-relay-bin-master1.000001 4 Format_desc 3 248 Server version
|
||||
mysqld-relay-bin-master1.000001 248 Rotate 3 306 mysqld-relay-bin-master1.000002;pos=4
|
||||
mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4
|
||||
drop table t1;
|
||||
include/reset_master_slave.inc
|
||||
include/reset_master_slave.inc
|
||||
|
@ -31,10 +31,11 @@ create table t1 (i int) engine=MyISAM;
|
||||
--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;
|
||||
let binlog_start=4;
|
||||
let binlog_file= mysqld-relay-bin-master1.000002;
|
||||
source include/show_relaylog_events.inc;
|
||||
let binlog_file=;
|
||||
source include/show_relaylog_events.inc;
|
||||
|
||||
--connection master1
|
||||
drop table t1;
|
||||
|
@ -11,14 +11,14 @@ 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 Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
|
||||
127.0.0.1 root MYPORT_1 60 master-bin.000001 802 mysqld-relay-bin-master1.000002 1090 master-bin.000001 No No 0 0 802 1396 None 0 No NULL No 0 0 1 No conservative
|
||||
127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-master1.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space> None 0 No NULL No 0 0 1 No conservative
|
||||
mysqld-relay-bin-master1.000001
|
||||
mysqld-relay-bin-master1.000002
|
||||
mysqld-relay-bin-master1.index
|
||||
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 Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
|
||||
127.0.0.1 root MYPORT_1 60 4 1090 No No 0 0 0 1396 None 0 No NULL No 0 0 1 No conservative
|
||||
127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space> None 0 No NULL No 0 0 1 No conservative
|
||||
reset slave 'master1' all;
|
||||
show slave 'master1' status;
|
||||
ERROR HY000: There is no master connection 'master1'
|
||||
|
@ -3,6 +3,7 @@
|
||||
#
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/binlog_start_pos.inc
|
||||
--let $rpl_server_count= 0
|
||||
|
||||
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
|
||||
@ -38,13 +39,16 @@ stop slave 'master1';
|
||||
|
||||
--let $datadir = `SELECT @@datadir`
|
||||
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1
|
||||
let read_master_log_pos=`select $binlog_start_pos + 554`;
|
||||
let relay_log_pos=`select 2*$binlog_start_pos + 594`;
|
||||
let relay_log_space=`select 3*$binlog_start_pos + 652`;
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space <relay_log_space>
|
||||
show slave 'master1' status;
|
||||
--list_files $datadir mysqld*
|
||||
|
||||
reset slave 'master1';
|
||||
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $relay_log_pos <relay_log_pos> $relay_log_space <relay_log_space>
|
||||
show slave 'master1' status;
|
||||
--list_files $datadir mysqld*
|
||||
|
||||
|
@ -11,8 +11,8 @@ include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
show all slaves status;
|
||||
Connection_name Slave_SQL_State 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 Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
|
||||
slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-slave1.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
|
||||
slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave1.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
|
||||
slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
start all slaves;
|
||||
stop slave 'slave1';
|
||||
show slave 'slave1' status;
|
||||
@ -22,9 +22,9 @@ Master_User root
|
||||
Master_Port MYPORT_1
|
||||
Connect_Retry 60
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 313
|
||||
Read_Master_Log_Pos <read_master_log_pos>
|
||||
Relay_Log_File mysqld-relay-bin-slave1.000002
|
||||
Relay_Log_Pos 601
|
||||
Relay_Log_Pos <relay_log_pos>
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running No
|
||||
Slave_SQL_Running No
|
||||
@ -37,8 +37,8 @@ Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 313
|
||||
Relay_Log_Space 906
|
||||
Exec_Master_Log_Pos <read_master_log_pos>
|
||||
Relay_Log_Space <relay_log_space1>
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
@ -66,18 +66,18 @@ Parallel_Mode conservative
|
||||
reset slave 'slave1';
|
||||
show all slaves status;
|
||||
Connection_name Slave_SQL_State 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 Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
|
||||
slave1 127.0.0.1 root MYPORT_1 60 4 601 No No 0 0 0 906 None 0 No NULL No 0 0 1 No conservative 0 1073741824 7 0 60.000
|
||||
slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
slave1 127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space1> None 0 No NULL No 0 0 1 No conservative 0 1073741824 7 0 60.000
|
||||
slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
reset slave 'slave1' all;
|
||||
show all slaves status;
|
||||
Connection_name Slave_SQL_State 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 Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
|
||||
slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
stop all slaves;
|
||||
Warnings:
|
||||
Note 1938 SLAVE 'slave2' stopped
|
||||
show all slaves status;
|
||||
Connection_name Slave_SQL_State 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 Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
|
||||
slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 No No 0 0 313 906 None 0 No NULL No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space1> None 0 No NULL No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
stop all slaves;
|
||||
include/reset_master_slave.inc
|
||||
include/reset_master_slave.inc
|
||||
|
@ -3,6 +3,7 @@
|
||||
#
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/binlog_start_pos.inc
|
||||
--let $rpl_server_count= 0
|
||||
|
||||
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
|
||||
@ -40,7 +41,11 @@ let $condition = = 7;
|
||||
let $wait_for_all = 1;
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
|
||||
let read_master_log_pos=`select $binlog_start_pos + 65`;
|
||||
let relay_log_pos=`select 2*$binlog_start_pos + 105`;
|
||||
let relay_log_space1=`select 3*$binlog_start_pos + 162`;
|
||||
let relay_log_space2=`select 3*$binlog_start_pos + 162`;
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
|
||||
show all slaves status;
|
||||
|
||||
# Ensure that start all slaves doesn't do anything as all slaves are started
|
||||
@ -48,19 +53,19 @@ start all slaves;
|
||||
|
||||
stop slave 'slave1';
|
||||
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
|
||||
query_vertical show slave 'slave1' status;
|
||||
|
||||
reset slave 'slave1';
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
|
||||
show all slaves status;
|
||||
|
||||
reset slave 'slave1' all;
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
|
||||
show all slaves status;
|
||||
|
||||
stop all slaves;
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
|
||||
show all slaves status;
|
||||
|
||||
# Ensure that start all slaves doesn't do anything as all slaves are stopped
|
||||
|
Reference in New Issue
Block a user