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