| 1 |
############################################################################### |
| 2 |
# |
| 3 |
# When an configuration change is accepted, even if the invoking |
| 4 |
# member leaves or fails under a majority, the action will be executed |
| 5 |
# in all online members. |
| 6 |
# |
| 7 |
# Test: |
| 8 |
# 0. This test needs 3 servers |
| 9 |
# 1. Set an debug point on server to block group action after |
| 10 |
# configuration is accepted |
| 11 |
# 2. Execute switch to single primary mode |
| 12 |
# 3. Kill server that is executing action |
| 13 |
# 4. Confirm other members executed the action |
| 14 |
# 5. Clean up |
| 15 |
# |
| 16 |
############################################################################### |
| 17 |
|
| 18 |
--source include/have_debug.inc |
| 19 |
--source include/have_group_replication_plugin.inc |
| 20 |
--source include/not_valgrind.inc |
| 21 |
--let $rpl_server_count= 3 |
| 22 |
--source include/group_replication.inc |
| 23 |
|
| 24 |
--echo |
| 25 |
--echo # 1. Set an debug point on server to block group action after |
| 26 |
--echo # configuration is accepted |
| 27 |
|
| 28 |
SET @@GLOBAL.DEBUG= '+d,group_replication_block_group_action'; |
| 29 |
|
| 30 |
--let $rpl_connection_name= server2 |
| 31 |
--source include/rpl_connection.inc |
| 32 |
--let $server2_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1) |
| 33 |
|
| 34 |
--let $rpl_connection_name= server3 |
| 35 |
--source include/rpl_connection.inc |
| 36 |
|
| 37 |
--echo |
| 38 |
--echo # 2. Execute switch to single primary mode |
| 39 |
|
| 40 |
--let $rpl_connection_name= server1 |
| 41 |
--source include/rpl_connection.inc |
| 42 |
|
| 43 |
--replace_result $server2_uuid MEMBER2_UUID |
| 44 |
--send_eval SELECT group_replication_switch_to_single_primary_mode("$server2_uuid") |
| 45 |
|
| 46 |
--echo |
| 47 |
--echo # 3. Kill server that is executing action |
| 48 |
|
| 49 |
--let $rpl_connection_name= server_1 |
| 50 |
--source include/rpl_connection.inc |
| 51 |
|
| 52 |
# verify thread THD_group_action_coordinator has started |
| 53 |
--let $wait_condition= SELECT COUNT(*)=1 FROM performance_schema.threads WHERE NAME = "thread/group_rpl/THD_group_action_coordinator" |
| 54 |
--source include/wait_condition.inc |
| 55 |
|
| 56 |
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address` |
| 57 |
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds` |
| 58 |
|
| 59 |
--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 |
| 60 |
--let $restart_parameters=restart:--group-replication-start-on-boot=0 --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_single_primary_mode=TRUE --group_replication_enforce_update_everywhere_checks=FALSE |
| 61 |
--source include/kill_and_restart_mysqld.inc |
| 62 |
|
| 63 |
--let $rpl_connection_name= server1 |
| 64 |
--source include/rpl_connection.inc |
| 65 |
--error CR_SERVER_LOST |
| 66 |
--reap |
| 67 |
|
| 68 |
--let $rpl_connection_name= server_1 |
| 69 |
--source include/rpl_connection.inc |
| 70 |
--let $rpl_server_number= 1 |
| 71 |
--source include/rpl_reconnect.inc |
| 72 |
|
| 73 |
--echo |
| 74 |
--echo # 4. Confirm other members executed the action |
| 75 |
|
| 76 |
--let $rpl_connection_name= server2 |
| 77 |
--source include/rpl_connection.inc |
| 78 |
|
| 79 |
--let $group_replication_number_of_members= 2 |
| 80 |
--source include/gr_wait_for_number_of_members.inc |
| 81 |
|
| 82 |
--let $wait_condition=SELECT COUNT(*)=0 FROM performance_schema.events_stages_current WHERE event_name LIKE "%stage/group_rpl%" AND event_name NOT LIKE "%stage/group_rpl/Group Replication%" |
| 83 |
--source include/wait_condition.inc |
| 84 |
|
| 85 |
--source include/gr_assert_primary_member.inc |
| 86 |
|
| 87 |
--let $rpl_connection_name= server3 |
| 88 |
--source include/rpl_connection.inc |
| 89 |
|
| 90 |
--let $wait_condition=SELECT COUNT(*)=0 FROM performance_schema.events_stages_current WHERE event_name LIKE "%stage/group_rpl%" AND event_name NOT LIKE "%stage/group_rpl/Group Replication%" |
| 91 |
--source include/wait_condition.inc |
| 92 |
|
| 93 |
--source include/gr_assert_secondary_member.inc |
| 94 |
|
| 95 |
--echo |
| 96 |
--echo # 5. Clean up |
| 97 |
|
| 98 |
--let $rpl_connection_name= server1 |
| 99 |
--source include/rpl_connection.inc |
| 100 |
|
| 101 |
--let $rpl_group_replication_single_primary_mode=1 |
| 102 |
--let $rpl_group_replication_reset_persistent_vars=1 |
| 103 |
--source include/group_replication_end.inc |