| 1 |
############################################################################### |
| 2 |
# |
| 3 |
# In the unlikely case a member receives a message that it does not knows, |
| 4 |
# that member will leave the group/abort |
| 5 |
# |
| 6 |
# Test: |
| 7 |
# 0. The test need two servers. They start in multi primary mode |
| 8 |
# 1. Start the group making server 2 have a debug point to fail |
| 9 |
# 2. Execute an action to change group to single primary mode on server 1 |
| 10 |
# Server 2 shall leave the group and enable its read mode. |
| 11 |
# 3. Restart group replication on server 2 |
| 12 |
# 4. Change the exit action to Abort |
| 13 |
# Execute an action to change group to multi primary mode on server 1 |
| 14 |
# Server 2 shall abort. |
| 15 |
# 5. Cleanup |
| 16 |
# |
| 17 |
############################################################################### |
| 18 |
|
| 19 |
--source include/big_test.inc |
| 20 |
--source include/have_debug_sync.inc |
| 21 |
--source include/have_group_replication_plugin.inc |
| 22 |
--let $rpl_skip_group_replication_start= 1 |
| 23 |
--source include/group_replication.inc |
| 24 |
|
| 25 |
--echo |
| 26 |
--echo # 1. Start the group making server 2 have a debug point to fail |
| 27 |
|
| 28 |
--let $rpl_connection_name= server1 |
| 29 |
--source include/rpl_connection.inc |
| 30 |
|
| 31 |
--source include/start_and_bootstrap_group_replication.inc |
| 32 |
|
| 33 |
--let $rpl_connection_name= server2 |
| 34 |
--source include/rpl_connection.inc |
| 35 |
|
| 36 |
SET @@GLOBAL.DEBUG= '+d,group_replication_group_action_start_msg_error'; |
| 37 |
--source include/start_group_replication.inc |
| 38 |
|
| 39 |
--echo |
| 40 |
--echo # 2. Execute an action to change group to single primary mode on server 1 |
| 41 |
--echo # Server 2 shall abort |
| 42 |
--let $rpl_connection_name= server1 |
| 43 |
--source include/rpl_connection.inc |
| 44 |
|
| 45 |
SELECT group_replication_switch_to_single_primary_mode(); |
| 46 |
|
| 47 |
--let $rpl_connection_name= server2 |
| 48 |
--source include/rpl_connection.inc |
| 49 |
|
| 50 |
--source include/wait_until_disconnected.inc |
| 51 |
# Inform MTR that it should restart the aborted member |
| 52 |
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect |
| 53 |
|
| 54 |
--let $rpl_server_number= 2 |
| 55 |
--source include/rpl_reconnect.inc |
| 56 |
--let $rpl_connection_name= server2 |
| 57 |
--source include/rpl_connection.inc |
| 58 |
|
| 59 |
--echo |
| 60 |
--echo # 5. Cleanup |
| 61 |
|
| 62 |
# No need for a debug flag cleanup after restart |
| 63 |
|
| 64 |
SET SESSION sql_log_bin=0; |
| 65 |
call mtr.add_suppression("A configuration change was killed in this member. The member will now leave the group as its configuration may have diverged."); |
| 66 |
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); |
| 67 |
call mtr.add_suppression("On shutdown there was a timeout receiving a view change. This can lead to a possible inconsistent state. Check the log for more details"); |
| 68 |
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); |
| 69 |
call mtr.add_suppression("Error while executing a group configuration operation: This member received an unknown action for execution."); |
| 70 |
call mtr.add_suppression("The plugin encountered a critical error and will abort: Fatal error during a Group Replication configuration change. This member received an unknown action for execution."); |
| 71 |
SET SESSION sql_log_bin=1; |
| 72 |
|
| 73 |
--let $rpl_group_replication_single_primary_mode=1 |
| 74 |
--let $rpl_group_replication_reset_persistent_vars=1 |
| 75 |
--source include/group_replication_end.inc |