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
|
###############################################################################
#
# No configuration change can happen if one of the members is in recovery mode.
#
# Test:
# 0. The test requires two servers.
# 1. Server1 bootstrap group
# 2. Start server 2 that will block on recovery
# 3. Execute action switch to single primary that will fail due a server
# is blocked on recovery
# 4. Resume recovery on server2
# 5. Cleanup
#
###############################################################################
--source include/have_debug_sync.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc
--echo
--echo # 1. Server1 bootstrap group
--source include/start_and_bootstrap_group_replication.inc
--let $server1_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
--echo
--echo # 3. Start server 2 that will block on recovery
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
set session sql_log_bin=0;
call mtr.add_suppression("Error while executing a group configuration operation: A member is joining the group, wait for it to be ONLINE.");
set session sql_log_bin=1;
SET @@GLOBAL.DEBUG='+d,recovery_thread_wait_before_finish';
--let $group_replication_start_member_state= RECOVERING
--source include/start_group_replication.inc
--echo
--echo # 4. Execute action switch to single primary that will fail due a server
--echo # is blocked on recovery
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
set session sql_log_bin=0;
call mtr.add_suppression("The function 'group_replication_switch_to_single_primary_mode' failed. A member is joining the group.*");
set session sql_log_bin=1;
--replace_result $server1_uuid MEMBER1_UUID
--error ER_CANT_INITIALIZE_UDF
--eval SELECT group_replication_switch_to_single_primary_mode("$server1_uuid")
--echo
--echo # 5. Resume recovery on server2
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET DEBUG_SYNC= "now WAIT_FOR signal.recovery_thread_wait_before_finish_reached";
SET @@GLOBAL.DEBUG='-d,recovery_thread_wait_before_finish';
SET DEBUG_SYNC= "now SIGNAL signal.recovery_end";
--let $group_replication_member_state= ONLINE
--source include/gr_wait_for_member_state.inc
SET DEBUG_SYNC= 'RESET';
--echo
--echo # 6. Cleanup
--source include/group_replication_end.inc
|