mariadb/mysql-test/main/master_retry_count_basic.test
2025-04-29 13:53:16 +10:00

80 lines
2.8 KiB
Text

# MDEV-25674: Test the `Master_Retry_Count` field of
# CHANGE MASTER [name] TO and SHOW SLAVE [name] STATUS & co. (no feature testing)
# Two connections tests that the field is now per-connection.
--source include/have_perfschema.inc
--echo # Use `--master-retry-count` when not specified
CHANGE MASTER 'named' TO master_host='example.com';
CHANGE MASTER TO master_host='127.0.0.1', master_ssl_verify_server_cert=0;
SELECT Connection_name, Master_Retry_Count
FROM information_schema.SLAVE_STATUS;
--echo # Replace when specified
CHANGE MASTER 'named' TO master_retry_count=11;
# Default master does not replace named master
CHANGE MASTER TO master_retry_count=10;
SELECT Connection_name, Master_Retry_Count
FROM information_schema.SLAVE_STATUS;
--echo # Conventional views also show the configurations
--let $all_slaves_status= 1
--let $status_items= Connection_name, Master_Retry_Count
--source include/show_slave_status.inc
--let $all_slaves_status= 0
--let $status_items= Master_Retry_Count
--source include/show_slave_status.inc
--let $slave_name= 'named'
--source include/show_slave_status.inc
SELECT CHANNEL_NAME, CONNECTION_RETRY_COUNT
FROM performance_schema.replication_connection_configuration;
--echo # Restore specified config on restart
--let $restart_parameters= --skip-slave-start
--source include/restart_mysqld.inc # not_embedded
SELECT Connection_name, Master_Retry_Count
FROM information_schema.SLAVE_STATUS;
--echo # Keep specified config on RESET REPLICA
RESET REPLICA 'named';
RESET REPLICA;
SELECT Connection_name, Master_Retry_Count
FROM information_schema.SLAVE_STATUS;
--echo # Don't replace when not specified
CHANGE MASTER TO master_user='root';
CHANGE MASTER 'named' TO master_user='root';
SELECT Connection_name, Master_Retry_Count
FROM information_schema.SLAVE_STATUS;
--echo # 0 internally means "not specified"
CHANGE MASTER TO master_retry_count=0;
CHANGE MASTER 'named' TO master_retry_count=0;
SELECT Connection_name, Master_Retry_Count
FROM information_schema.SLAVE_STATUS;
--echo # Truncates decimals
CHANGE MASTER TO master_retry_count=0.5;
CHANGE MASTER 'named' TO master_retry_count=0.5;
SELECT Connection_name, Master_Retry_Count
FROM information_schema.SLAVE_STATUS;
--echo # Caps values (such as UINT64_MAX + 1) to `--master-retry-count`'s max
CHANGE MASTER TO master_retry_count=18446744073709551616;
CHANGE MASTER 'named' TO master_retry_count=18446744073709551616;
SELECT Connection_name
FROM information_schema.SLAVE_STATUS
WHERE Master_Retry_Count IN (4294967295, 18446744073709551615);
--echo # Negative
--error ER_PARSE_ERROR
CHANGE MASTER TO master_retry_count=-1;
--error ER_PARSE_ERROR
CHANGE MASTER 'named' TO master_retry_count=-1;
--echo # NaN
--error ER_PARSE_ERROR
CHANGE MASTER TO master_retry_count='5';
--error ER_PARSE_ERROR
CHANGE MASTER 'named' TO master_retry_count='5';
--echo # Cleanup
RESET REPLICA 'named' ALL;