1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
###############################################################################
# Validate the behavior of error handling on member actions execution.
#
# Test:
# 0. This test requires two servers
# 1. Inject a failure into `mysql_disable_super_read_only_if_primary`
# execution.
# 2. Inject a failure into `mysql_disable_super_read_only_if_primary`
# execution, while also forcing the error handling to "CRITICAL".
# 3. Clean up
###############################################################################
--source include/have_debug.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--let $rpl_group_replication_single_primary_mode=1
--source include/group_replication.inc
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET SESSION sql_log_bin = 0;
call mtr.add_suppression("Unable to disable super read only flag. Try to disable it manually");
call mtr.add_suppression("The member action \"mysql_disable_super_read_only_if_primary\" for event \"AFTER_PRIMARY_ELECTION\" with priority \"1\" failed, this error is ignored as instructed. Please check previous messages in the error log for hints about*");
call mtr.add_suppression("The member action \"mysql_disable_super_read_only_if_primary\" for event \"AFTER_PRIMARY_ELECTION\" with priority \"1\" failed. Please check previous messages in the error log for hints about what could have caused this failure.");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("Error while sending message. Context: primary election process.");
SET SESSION sql_log_bin = 1;
--echo
--echo ############################################################
--echo # 1. Inject a failure into `mysql_disable_super_read_only_if_primary`
--echo # execution.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @@GLOBAL.DEBUG='+d,group_replication_force_error_on_mysql_disable_super_read_only_if_primary';
--source include/start_and_bootstrap_group_replication.inc
--let $assert_only_after = CURRENT_TEST: group_replication.gr_member_actions_error_handling
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_select= The member action "mysql_disable_super_read_only_if_primary" for event "AFTER_PRIMARY_ELECTION" with priority "1" failed, this error is ignored as instructed. Please check previous messages in the error log for hints about what could have caused this failure.
--let $assert_count= 1
--let $assert_text= The member action "mysql_disable_super_read_only_if_primary" for event "AFTER_PRIMARY_ELECTION" with priority "1" failed, this error is ignored as instructed. Please check previous messages in the error log for hints about what could have caused this failure.
--source include/assert_grep.inc
SET @@GLOBAL.DEBUG='-d,group_replication_force_error_on_mysql_disable_super_read_only_if_primary';
--source include/stop_group_replication.inc
--echo
--echo ############################################################
--echo # 2. Inject a failure into `mysql_disable_super_read_only_if_primary`
--echo # execution, while also forcing the error handling to "CRITICAL".
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @@GLOBAL.DEBUG='+d,group_replication_force_error_on_mysql_disable_super_read_only_if_primary';
SET @@GLOBAL.DEBUG='+d,group_replication_force_action_error_handling_critical';
SET GLOBAL group_replication_bootstrap_group= 1;
START GROUP_REPLICATION;
SET GLOBAL group_replication_bootstrap_group= 0;
--let $group_replication_member_state = ERROR
--source include/gr_wait_for_member_state.inc
--let $assert_only_after = CURRENT_TEST: group_replication.gr_member_actions_error_handling
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_select= The member action "mysql_disable_super_read_only_if_primary" for event "AFTER_PRIMARY_ELECTION" with priority "1" failed. Please check previous messages in the error log for hints about what could have caused this failure.
--let $assert_count= 1
--let $assert_text= The member action "mysql_disable_super_read_only_if_primary" for event "AFTER_PRIMARY_ELECTION" with priority "1" failed. Please check previous messages in the error log for hints about what could have caused this failure.
--source include/assert_grep.inc
--let $assert_only_after = CURRENT_TEST: group_replication.gr_member_actions_error_handling
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_select= The server was automatically set into read only mode after an error was detected.
--let $assert_count= 1
--let $assert_text= The server was automatically set into read only mode after an error was detected.
--source include/assert_grep.inc
SET @@GLOBAL.DEBUG='-d,group_replication_force_error_on_mysql_disable_super_read_only_if_primary';
SET @@GLOBAL.DEBUG='-d,group_replication_force_action_error_handling_critical';
--source include/stop_group_replication.inc
--echo
--echo ############################################################
--echo # 3. Clean up.
--source include/group_replication_end.inc
|