mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-35304: Add Connects_Tried
and Master_Retry_Count
to SSS
When the IO thread (re)connect to a primary, no updates are available besides unique errors that cause the failure. These new `Master_info` numbers supplement SHOW SLAVE STATUS’s (most- recent) ‘Connecting’ state with statistics on (re)connect attempts: * `Connects_Tried`: how many retries have been attempted so far This was previously a local variable that only counted re-attempts; it’s now meaningful even after the “Connecting” state concludes. * `Master_Retry_Count` (from MDEV-25674): out of how many configured Side-note: Some of the tests updated by this commit dump the entire SHOW SLAVE STATUS, which might include non-deterministic entries. Reviewed-by: Kristian Nielsen <knielsen@knielsen-hq.org> Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
This commit is contained in:
102
mysql-test/suite/multi_source/connects_tried.result
Normal file
102
mysql-test/suite/multi_source/connects_tried.result
Normal file
@ -0,0 +1,102 @@
|
||||
include/master-slave.inc [rpl_server_count=3]
|
||||
[connection master]
|
||||
include/rpl_stop_server.inc [server_number=1]
|
||||
include/rpl_stop_server.inc [server_number=3]
|
||||
connection slave;
|
||||
CHANGE MASTER TO master_connect_retry=1;
|
||||
CHANGE MASTER 'named' TO master_host='127.0.0.1', master_port=SERVER_MYPORT_3, master_user='root', master_ssl_verify_server_cert=0, master_connect_retry=2;
|
||||
# `Connects_Tried` is 0 before connections begin.
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
Connection_name Connects_Tried
|
||||
0
|
||||
named 0
|
||||
START ALL SLAVES;
|
||||
SET @@SESSION.default_master_connection= 'named';
|
||||
include/wait_for_slave_io_error.inc [errno=2003]
|
||||
SET @@SESSION.default_master_connection= '';
|
||||
include/wait_for_slave_io_error.inc [errno=2003]
|
||||
CREATE TEMPORARY TABLE status_begin AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
# `Connects_Tried` is 1 immediately after connections begin.
|
||||
SELECT Connection_name, Connects_Tried
|
||||
FROM status_begin
|
||||
WHERE Connects_Tried <= 0;
|
||||
Connection_name Connects_Tried
|
||||
DO SLEEP(3);
|
||||
# `Connects_Tried` increments (at least) 3 for connection '' and 1 for 'named'.
|
||||
CREATE TEMPORARY TABLE status_sleep AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_begin JOIN status_sleep USING(Connection_name)
|
||||
WHERE status_sleep.Connects_Tried - status_begin.Connects_Tried <
|
||||
IF(LENGTH(Connection_name), 1, 3);
|
||||
Connection_name Connects_Tried Connects_Tried
|
||||
# Boot replication up and assert final count
|
||||
include/rpl_start_server.inc [server_number=1]
|
||||
include/rpl_start_server.inc [server_number=3]
|
||||
connection slave;
|
||||
SET @@SESSION.default_master_connection= 'named';
|
||||
include/wait_for_slave_param.inc [Slave_IO_Running]
|
||||
SET @@SESSION.default_master_connection= '';
|
||||
include/wait_for_slave_param.inc [Slave_IO_Running]
|
||||
CREATE TEMPORARY TABLE status_end AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
# `Connects_Tried` increments (at least) 1 for each connection.
|
||||
SELECT *
|
||||
FROM status_sleep JOIN status_end USING(Connection_name)
|
||||
WHERE status_end.Connects_Tried <= status_sleep.Connects_Tried;
|
||||
Connection_name Connects_Tried Connects_Tried
|
||||
DO SLEEP(2);
|
||||
# `Connects_Tried` does not increment after connection establishes.
|
||||
CREATE TEMPORARY TABLE status_after AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_end JOIN status_after USING(Connection_name)
|
||||
WHERE status_after.Connects_Tried <> status_end.Connects_Tried;
|
||||
Connection_name Connects_Tried Connects_Tried
|
||||
# Conventional views
|
||||
SELECT * FROM status_end;
|
||||
Connection_name Connects_Tried
|
||||
connects_tried
|
||||
named connects_tried_named
|
||||
SELECT * FROM status_end;
|
||||
Connection_name Connects_Tried
|
||||
connects_tried
|
||||
named connects_tried_named
|
||||
STOP ALL SLAVES;
|
||||
SET @@SESSION.default_master_connection= 'named';
|
||||
include/wait_for_slave_to_stop.inc
|
||||
SET @@SESSION.default_master_connection= '';
|
||||
include/wait_for_slave_to_stop.inc
|
||||
# STOP SLAVE does not reset `Connects_Tried`.
|
||||
CREATE TEMPORARY TABLE status_stop AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_after JOIN status_stop USING(Connection_name)
|
||||
WHERE status_stop.Connects_Tried <> status_after.Connects_Tried;
|
||||
Connection_name Connects_Tried Connects_Tried
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
# START SLAVE recounts `Connects_Tried` from 1 (for the restarted connection only).
|
||||
CREATE TEMPORARY TABLE status_restart AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_restart JOIN status_stop USING(Connection_name)
|
||||
WHERE status_restart.Connects_Tried NOT BETWEEN IF(
|
||||
LENGTH(Connection_name), status_stop.Connects_Tried, 1
|
||||
) AND status_stop.Connects_Tried;
|
||||
Connection_name Connects_Tried Connects_Tried
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
RESET SLAVE;
|
||||
# RESET SLAVE resets `Connects_Tried` to 0 (for the resetted connection only).
|
||||
CREATE TEMPORARY TABLE status_reset AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_reset JOIN status_restart USING(Connection_name)
|
||||
WHERE status_reset.Connects_Tried <>
|
||||
IF(LENGTH(Connection_name), status_restart.Connects_Tried, 0);
|
||||
Connection_name Connects_Tried Connects_Tried
|
||||
# Cleanup
|
||||
RESET SLAVE 'named' ALL;
|
||||
include/rpl_end.inc
|
133
mysql-test/suite/multi_source/connects_tried.test
Normal file
133
mysql-test/suite/multi_source/connects_tried.test
Normal file
@ -0,0 +1,133 @@
|
||||
# MDEV-35304: Test the `Connects_Tried` feature
|
||||
#
|
||||
# Two connections with different retry frequencies tests their
|
||||
# separate counters in parallel multi-source (SHOW SLAVE [name] STATUS).
|
||||
#
|
||||
# Note: nearly all SELECT results are timing-sensitive,
|
||||
# they therefore list unexpected rows because.
|
||||
|
||||
--source include/have_binlog_format_mixed.inc # The test is agnostic of binlog formats.
|
||||
# `rpl_*.inc` (still) expects `server_1` be `master` and `server_2` be `slave`.
|
||||
--let $rpl_server_count= 3
|
||||
--let $rpl_skip_start_slave= 1
|
||||
--source include/master-slave.inc
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_stop_server.inc
|
||||
--let $rpl_server_number= 3
|
||||
--source include/rpl_stop_server.inc
|
||||
|
||||
--connection slave
|
||||
CHANGE MASTER TO master_connect_retry=1;
|
||||
--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3
|
||||
--eval CHANGE MASTER 'named' TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_3, master_user='root', master_ssl_verify_server_cert=0, master_connect_retry=2
|
||||
--echo # `Connects_Tried` is 0 before connections begin.
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
|
||||
--disable_warnings
|
||||
START ALL SLAVES; # will fail because the masters are down
|
||||
# CR_CONN_HOST_ERROR
|
||||
--let $slave_io_errno= 2003
|
||||
--let $slave_io_error_is_nonfatal= 1
|
||||
SET @@SESSION.default_master_connection= 'named';
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
--let $slave_io_error_is_nonfatal= 1
|
||||
SET @@SESSION.default_master_connection= '';
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
--enable_warnings
|
||||
|
||||
CREATE TEMPORARY TABLE status_begin AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
--echo # `Connects_Tried` is 1 immediately after connections begin.
|
||||
SELECT Connection_name, Connects_Tried
|
||||
FROM status_begin
|
||||
WHERE Connects_Tried <= 0;
|
||||
|
||||
DO SLEEP(3);
|
||||
--echo # `Connects_Tried` increments (at least) 3 for connection '' and 1 for 'named'.
|
||||
CREATE TEMPORARY TABLE status_sleep AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_begin JOIN status_sleep USING(Connection_name)
|
||||
WHERE status_sleep.Connects_Tried - status_begin.Connects_Tried <
|
||||
IF(LENGTH(Connection_name), 1, 3);
|
||||
|
||||
--echo # Boot replication up and assert final count
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_start_server.inc
|
||||
--let $rpl_server_number= 3
|
||||
--source include/rpl_start_server.inc
|
||||
--connection slave
|
||||
# `wait_for_slave_io_to_start.inc` fails if the IO thread has an error.
|
||||
--let $slave_param= Slave_IO_Running
|
||||
--let $slave_param_value= Yes
|
||||
SET @@SESSION.default_master_connection= 'named';
|
||||
--source include/wait_for_slave_param.inc
|
||||
SET @@SESSION.default_master_connection= '';
|
||||
--source include/wait_for_slave_param.inc
|
||||
|
||||
CREATE TEMPORARY TABLE status_end AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
--echo # `Connects_Tried` increments (at least) 1 for each connection.
|
||||
SELECT *
|
||||
FROM status_sleep JOIN status_end USING(Connection_name)
|
||||
WHERE status_end.Connects_Tried <= status_sleep.Connects_Tried;
|
||||
|
||||
DO SLEEP(2);
|
||||
--echo # `Connects_Tried` does not increment after connection establishes.
|
||||
CREATE TEMPORARY TABLE status_after AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_end JOIN status_after USING(Connection_name)
|
||||
WHERE status_after.Connects_Tried <> status_end.Connects_Tried;
|
||||
|
||||
--echo # Conventional views
|
||||
--let $connects_tried= query_get_value("SHOW SLAVE STATUS", Connects_Tried, 1)
|
||||
--let $connects_tried_named= query_get_value("SHOW SLAVE 'named' STATUS", Connects_Tried, 1)
|
||||
--replace_result $connects_tried connects_tried $connects_tried_named connects_tried_named
|
||||
SELECT * FROM status_end;
|
||||
--let $connects_tried= query_get_value("SHOW ALL SLAVES STATUS", Connects_Tried, 1)
|
||||
--let $connects_tried_named= query_get_value("SHOW ALL SLAVES STATUS", Connects_Tried, 2)
|
||||
--replace_result $connects_tried connects_tried $connects_tried_named connects_tried_named
|
||||
SELECT * FROM status_end;
|
||||
|
||||
--disable_warnings
|
||||
STOP ALL SLAVES;
|
||||
SET @@SESSION.default_master_connection= 'named';
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
SET @@SESSION.default_master_connection= '';
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
--enable_warnings
|
||||
--echo # STOP SLAVE does not reset `Connects_Tried`.
|
||||
# That is, so the user can check this stat without leaving the slave spinning.
|
||||
CREATE TEMPORARY TABLE status_stop AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_after JOIN status_stop USING(Connection_name)
|
||||
WHERE status_stop.Connects_Tried <> status_after.Connects_Tried;
|
||||
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
--echo # START SLAVE recounts `Connects_Tried` from 1 (for the restarted connection only).
|
||||
CREATE TEMPORARY TABLE status_restart AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_restart JOIN status_stop USING(Connection_name)
|
||||
WHERE status_restart.Connects_Tried NOT BETWEEN IF(
|
||||
LENGTH(Connection_name), status_stop.Connects_Tried, 1
|
||||
) AND status_stop.Connects_Tried;
|
||||
|
||||
STOP SLAVE;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
RESET SLAVE;
|
||||
--echo # RESET SLAVE resets `Connects_Tried` to 0 (for the resetted connection only).
|
||||
CREATE TEMPORARY TABLE status_reset AS
|
||||
SELECT Connection_name, Connects_Tried FROM information_schema.SLAVE_STATUS;
|
||||
SELECT *
|
||||
FROM status_reset JOIN status_restart USING(Connection_name)
|
||||
WHERE status_reset.Connects_Tried <>
|
||||
IF(LENGTH(Connection_name), status_restart.Connects_Tried, 0);
|
||||
|
||||
--echo # Cleanup
|
||||
RESET SLAVE 'named' ALL;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_end.inc
|
@ -94,17 +94,17 @@ MASTER 2.2
|
||||
# EOF
|
||||
#
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Master_last_event_time Slave_last_event_time Master_Slave_time_diff
|
||||
Slave has read all relay log; waiting for more updates 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 Yes 0 No 0 0 1 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 7 0 60.000 NULL NULL NULL
|
||||
MASTER 2.2 Slave has read all relay log; waiting for more updates 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 Yes 0 No 0 0 2 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 7 0 60.000 NULL NULL NULL
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Connects_Tried Master_Retry_Count Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Master_last_event_time Slave_last_event_time Master_Slave_time_diff
|
||||
Slave has read all relay log; waiting for more updates 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 Yes 0 No 0 0 1 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 1 100000 0 1073741824 7 0 60.000 NULL NULL NULL
|
||||
MASTER 2.2 Slave has read all relay log; waiting for more updates 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 Yes 0 No 0 0 2 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 1 100000 0 1073741824 7 0 60.000 NULL NULL NULL
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Master_last_event_time Slave_last_event_time Master_Slave_time_diff
|
||||
Slave has read all relay log; waiting for more updates 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 Yes 0 No 0 0 1 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 6 0 60.000 NULL NULL NULL
|
||||
MASTER 2.2 Slave has read all relay log; waiting for more updates 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 Yes 0 No 0 0 2 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 6 0 60.000 NULL NULL NULL
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Connects_Tried Master_Retry_Count Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Master_last_event_time Slave_last_event_time Master_Slave_time_diff
|
||||
Slave has read all relay log; waiting for more updates 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 Yes 0 No 0 0 1 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 1 100000 0 1073741824 6 0 60.000 NULL NULL NULL
|
||||
MASTER 2.2 Slave has read all relay log; waiting for more updates 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 Yes 0 No 0 0 2 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 1 100000 0 1073741824 6 0 60.000 NULL NULL NULL
|
||||
#
|
||||
# List of files matching '*info*' pattern
|
||||
# after slave server restart
|
||||
|
@ -76,6 +76,8 @@ Slave_DDL_Groups 0
|
||||
Slave_Non_Transactional_Groups 0
|
||||
Slave_Transactional_Groups 0
|
||||
Replicate_Rewrite_DB
|
||||
Connects_Tried 1
|
||||
Master_Retry_Count 100000
|
||||
Retried_transactions 0
|
||||
Max_relay_log_size 1073741824
|
||||
Executed_log_entries 7
|
||||
@ -141,6 +143,8 @@ Slave_DDL_Groups 0
|
||||
Slave_Non_Transactional_Groups 0
|
||||
Slave_Transactional_Groups 0
|
||||
Replicate_Rewrite_DB
|
||||
Connects_Tried 1
|
||||
Master_Retry_Count 100000
|
||||
Retried_transactions 0
|
||||
Max_relay_log_size 1073741824
|
||||
Executed_log_entries 7
|
||||
|
@ -13,15 +13,15 @@ insert into t1 values (1),(2);
|
||||
connection slave;
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB
|
||||
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 Yes NULL No 0 0 1 Slave_Pos 0-1-3 optimistic 0 NULL 2 1 0
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Connects_Tried Master_Retry_Count
|
||||
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 Yes NULL No 0 0 1 Slave_Pos 0-1-3 optimistic 0 NULL 2 1 0 1 100000
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB
|
||||
127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space> None 0 Yes NULL No 0 0 1 Slave_Pos optimistic 0 NULL 2 1 0
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Connects_Tried Master_Retry_Count
|
||||
127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space> None 0 Yes NULL No 0 0 1 Slave_Pos optimistic 0 NULL 2 1 0 0 100000
|
||||
reset slave 'master1' all;
|
||||
show slave 'master1' status;
|
||||
ERROR HY000: There is no master connection 'master1'
|
||||
|
@ -74,6 +74,8 @@ Slave_DDL_Groups 0
|
||||
Slave_Non_Transactional_Groups 0
|
||||
Slave_Transactional_Groups 0
|
||||
Replicate_Rewrite_DB
|
||||
Connects_Tried 1
|
||||
Master_Retry_Count 100000
|
||||
Retried_transactions 0
|
||||
Max_relay_log_size 1073741824
|
||||
Executed_log_entries 7
|
||||
@ -139,6 +141,8 @@ Slave_DDL_Groups 0
|
||||
Slave_Non_Transactional_Groups 0
|
||||
Slave_Transactional_Groups 0
|
||||
Replicate_Rewrite_DB
|
||||
Connects_Tried 1
|
||||
Master_Retry_Count 100000
|
||||
Retried_transactions 0
|
||||
Max_relay_log_size 1073741824
|
||||
Executed_log_entries 7
|
||||
@ -269,6 +273,8 @@ Slave_DDL_Groups 0
|
||||
Slave_Non_Transactional_Groups 0
|
||||
Slave_Transactional_Groups 0
|
||||
Replicate_Rewrite_DB
|
||||
Connects_Tried 1
|
||||
Master_Retry_Count 100000
|
||||
reset slave 'slave1';
|
||||
show all slaves status;
|
||||
Connection_name slave1
|
||||
@ -327,6 +333,8 @@ Slave_DDL_Groups 0
|
||||
Slave_Non_Transactional_Groups 0
|
||||
Slave_Transactional_Groups 0
|
||||
Replicate_Rewrite_DB
|
||||
Connects_Tried 0
|
||||
Master_Retry_Count 100000
|
||||
Retried_transactions 0
|
||||
Max_relay_log_size 1073741824
|
||||
Executed_log_entries 7
|
||||
@ -392,6 +400,8 @@ Slave_DDL_Groups 0
|
||||
Slave_Non_Transactional_Groups 0
|
||||
Slave_Transactional_Groups 0
|
||||
Replicate_Rewrite_DB
|
||||
Connects_Tried 1
|
||||
Master_Retry_Count 100000
|
||||
Retried_transactions 0
|
||||
Max_relay_log_size 1073741824
|
||||
Executed_log_entries 7
|
||||
@ -459,6 +469,8 @@ Slave_DDL_Groups 0
|
||||
Slave_Non_Transactional_Groups 0
|
||||
Slave_Transactional_Groups 0
|
||||
Replicate_Rewrite_DB
|
||||
Connects_Tried 1
|
||||
Master_Retry_Count 100000
|
||||
Retried_transactions 0
|
||||
Max_relay_log_size 1073741824
|
||||
Executed_log_entries 7
|
||||
@ -528,6 +540,8 @@ Slave_DDL_Groups 0
|
||||
Slave_Non_Transactional_Groups 0
|
||||
Slave_Transactional_Groups 0
|
||||
Replicate_Rewrite_DB
|
||||
Connects_Tried 1
|
||||
Master_Retry_Count 100000
|
||||
Retried_transactions 0
|
||||
Max_relay_log_size 1073741824
|
||||
Executed_log_entries 7
|
||||
|
@ -1,11 +1,11 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
show slave 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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Connects_Tried Master_Retry_Count
|
||||
show slave '' 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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Connects_Tried Master_Retry_Count
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Master_last_event_time Slave_last_event_time Master_Slave_time_diff
|
||||
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 SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Connects_Tried Master_Retry_Count Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Master_last_event_time Slave_last_event_time Master_Slave_time_diff
|
||||
#
|
||||
# Check error handling
|
||||
#
|
||||
|
Reference in New Issue
Block a user