MINI MINI MANI MO

Path : /opt/mysql/mysql-test/suite/group_replication/t/
File Upload :
Current File : //opt/mysql/mysql-test/suite/group_replication/t/gr_relay_log_name_change.test

# ==== Purpose ====
#
# This test case will test the server behavior while enabling group replication
# on startup and changing the relay-log option.
#
# First, it will ensure that the server starts and enable GR if properly
# configured.
#
# Then, it will restart the server again change the relay-log option. The
# expected behavior is that GR should fail to start. It will remove the
# "group_replication_applier" channel manually in order to make it work
# properly on the next restart.
#
# Finally, the test will restart the server again and the GR plug-in should
# work fine.
#
# ==== Related Bugs and Worklogs ====
#
# BUG#23600405 CRASH IF RELAY LOG ISN'T FOUND
#
--source ../inc/have_group_replication_plugin.inc

SET SESSION sql_log_bin=0;
call mtr.add_suppression("Failed to open the relay log");
call mtr.add_suppression("Could not find target log file mentioned in relay log info in the index file");
call mtr.add_suppression("Failed to initialize the master info structure for channel");
call mtr.add_suppression("Failed to create or recover replication info repositories");
call mtr.add_suppression("Failed to setup the group replication applier thread");
call mtr.add_suppression("Unable to initialize the Group Replication applier module");
call mtr.add_suppression("Leaving a group without being on one");
call mtr.add_suppression("Error checking relay log repository.");
call mtr.add_suppression("Slave failed to initialize relay log info structure from the repository");
call mtr.add_suppression("Error while starting the group replication applier thread");
call mtr.add_suppression("It was not possible to identify the group replication applier thread");
call mtr.add_suppression("It was not possible to reset the server read mode settings. Try to reset them manually.");
call mtr.add_suppression("Error running internal SQL query:*");
SET SESSION sql_log_bin=1;

--source ../inc/start_and_bootstrap_group_replication.inc

--echo
--echo ##############################################
--echo # 1: Restart the server enabling GR on startup
--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 $_group_replication_group_whitelist= `SELECT @@GLOBAL.group_replication_ip_whitelist`
--let $restart_parameters=restart:--group-replication-start-on-boot=ON --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=ON --group_replication_ip_whitelist=$_group_replication_group_whitelist
--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 $_group_replication_group_whitelist GROUP_REPLICATION_GROUP_WHITELIST
--source include/restart_mysqld.inc

--let $group_replication_member_state= ONLINE
--source ../inc/gr_wait_for_member_state.inc

--echo
--echo #####################################################
--echo # 2: Restart the server changing the relay-log option
--let $allow_rpl_inited=1
--let $restart_parameters= $restart_parameters --relay-log=new-relay-log-name
--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 $_group_replication_group_whitelist GROUP_REPLICATION_GROUP_WHITELIST
--source include/restart_mysqld.inc

--let $wait_condition= SELECT last_error_number != 0 FROM performance_schema.replication_applier_status_by_worker where channel_name='group_replication_applier';
--source include/wait_condition.inc

--let $group_replication_member_state= OFFLINE
--source ../inc/gr_wait_for_member_state.inc

# As the slave repository was broken (by the relay-log option change)
# we need to fix the group_replication_applier channel manually.
RESET SLAVE FOR CHANNEL 'group_replication_applier';

--echo
--echo #######################################################
--echo # 3: Restart the server again after removing the broken
--echo #    group_replication_applier channel
--let $allow_rpl_inited=1
--let $restart_parameters= $restart_parameters --relay-log=new-relay-log-name
--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 $_group_replication_group_whitelist GROUP_REPLICATION_GROUP_WHITELIST
--source include/restart_mysqld.inc

--let $group_replication_member_state= ONLINE
--source ../inc/gr_wait_for_member_state.inc

--source include/stop_group_replication.inc
--let $skip_recovery_configuration= 1
--source ../inc/gr_clear_configuration.inc

OHA YOOOO