############################################################################### # Validation on recovery endpoints variable # # Test: # 0. The test requires two servers # 1. Persist only group_replication_advertise_recovery_endpoints, it # will be updated on configuration and read after restart # 2. Restart server and start Group Replication on boot, it will fail # due invalid configuration # 3. Assert server log message on wrong option on recovery endpoints # 4. Persist only group_replication_advertise_recovery_endpoints, it # will be updated on configuration and read after restart # 5. Restart server and start Group Replication on boot, it will fail # due configuration bad format # 6. Assert server log message on wrong option on recovery endpoints # 7. START GROUP_REPLICATION , it will fail due invalid format. # 8. Restart server and start Group Replication with command START # GROUP_REPLICATION , it will fail due invalid endpoint # 9. Try invalid configurations and confirm all return error # 10. Clean up # ############################################################################### --source include/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --source include/group_replication.inc --let $server1_port= `SELECT @@GLOBAL.PORT` --echo --echo # 1. Persist only group_replication_advertise_recovery_endpoints, it --echo # will be updated on configuration and read after restart SET PERSIST_ONLY group_replication_advertise_recovery_endpoints = "127.0.0.1:0"; --echo --echo # 2. Restart server and start Group Replication on boot, it will fail --echo # due invalid configuration --let $allow_rpl_inited= 1 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address` --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds` --let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 --group_replication_start_on_boot=1 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS --source include/restart_mysqld.inc --let $rpl_server_number= 1 --source include/rpl_reconnect.inc --echo --echo # 3. Assert server log message on wrong option on recovery endpoints --let $assert_only_after = CURRENT_TEST: group_replication.gr_recovery_endpoints_invalid_conf --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err --let $assert_count = 1 --let $assert_select = .*The server is not listening on endpoint '127.0.0.1:0'* --let $assert_text = invalid configuration used on recovery endpoints --source include/assert_grep.inc --echo --echo # 4. Persist only group_replication_advertise_recovery_endpoints, it --echo # will be updated on configuration and read after restart SET PERSIST_ONLY group_replication_advertise_recovery_endpoints = "127.0.0.1:3600a"; --echo --echo # 5. Restart server and start Group Replication on boot, it will fail --echo # due configuration bad format --let $allow_rpl_inited= 1 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address` --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds` --let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 --group_replication_start_on_boot=1 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS --source include/restart_mysqld.inc --let $rpl_server_number= 1 --source include/rpl_reconnect.inc --echo --echo # 6. Assert server log message on wrong option on recovery endpoints --let $assert_only_after = CURRENT_TEST: group_replication.gr_recovery_endpoints_invalid_conf --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err --let $assert_count = 1 --let $assert_select = .*Invalid input value for recovery socket endpoints '127.0.0.1:3600a'* --let $assert_text = invalid configuration used on recovery endpoints --source include/assert_grep.inc --echo --echo # 7. START GROUP_REPLICATION , it will fail due invalid format. --error ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT START GROUP_REPLICATION; --echo --echo # 8. Restart server and start Group Replication with command START --echo # GROUP_REPLICATION , it will fail due invalid endpoint SET PERSIST_ONLY group_replication_advertise_recovery_endpoints = "128.0.0.1:3600"; --let $allow_rpl_inited= 1 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address` --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds` --let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 --group_replication_start_on_boot=0 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS --source include/restart_mysqld.inc --let $rpl_server_number= 1 --source include/rpl_reconnect.inc --error ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID START GROUP_REPLICATION; --echo --echo # 9. Try invalid configurations and confirm all return error # Invalid port --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.1:0" # Invalid IPv4 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.500:1234" # Invalid IPv6 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "[::1:1234" # Valid IPv6 with port diferent from default or mysqld_admin --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "[::1]:1234" # Valid IPv6 but not from localhost --replace_result $server1_port SERVER1_PORT --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "[0:0:0:0:0:0:0:2]:$server1_port" # Invalid use of namespace --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.1/namespace:1234" # Hostname not present on machine --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "unusedhostname:1234" # Valid host with invalid port --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "localhost:123" # Empty string not allowed --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "" # Bad format without port --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.1" --echo --echo # 10. Clean up --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "DEFAULT" RESET PERSIST group_replication_advertise_recovery_endpoints; set session sql_log_bin=0; call mtr.add_suppression("Invalid input value for recovery socket endpoints '127.0.0.1:3600a'.*"); call mtr.add_suppression("The server is not listening on endpoint '127.0.0.1:0'.*"); call mtr.add_suppression("Unable to start Group Replication on boot"); set session sql_log_bin=1; --source include/group_replication_end.inc