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
|
################################################################################
# This test verifies that parallel execution of STOP GROUP_REPLICATION and
# Group Replication member actions change are handled properly by the server.
#
# Test:
# 0. The test requires one server: M1
# 1. Bootstrap a group on server1.
# Setup a debug point that will block a future
# STOP GROUP_REPLICATION command
# after the plugin_running_lock is acquired.
# 2. Asynchronously execute STOP GROUP_REPLICATION command.
# 3. Try to change Group Replication member actions while a
# STOP GROUP_REPLICATION is ongoing, they must fail.
# 4. Resume the STOP GROUP_REPLICATION command.
# 5. Clean up.
################################################################################
--source include/have_debug.inc
--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. Bootstrap a group on server1.
--echo # Setup a debug point that will block a future
--echo # STOP GROUP_REPLICATION command
--echo # after the plugin_running_lock is acquired.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source include/start_and_bootstrap_group_replication.inc
SET @@GLOBAL.DEBUG='+d,gr_plugin_gr_stop_after_holding_plugin_running_lock';
--echo ############################################################
--echo # 2. Asynchronously execute STOP GROUP_REPLICATION command.
--let $rpl_connection_name= server_1
--source include/rpl_connection.inc
--send STOP GROUP_REPLICATION
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET DEBUG_SYNC= "now WAIT_FOR signal.reached_plugin_gr_stop_after_holding_plugin_running_lock";
SET @@GLOBAL.DEBUG='-d,gr_plugin_gr_stop_after_holding_plugin_running_lock';
--echo ############################################################
--echo # 3. Try to change Group Replication member actions while a
--echo # STOP GROUP_REPLICATION is ongoing, they must fail.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--error ER_GRP_RPL_UDF_ERROR
SELECT group_replication_reset_member_actions();
--error ER_GRP_RPL_UDF_ERROR
SELECT group_replication_enable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION");
--error ER_GRP_RPL_UDF_ERROR
SELECT group_replication_disable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION");
--let $assert_text= The version of replication_group_member_actions must be 1
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_group_member_actions\', version, 1] = 1
--source include/assert.inc
--echo ############################################################
--echo # 4. Resume the STOP GROUP_REPLICATION command.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET DEBUG_SYNC= "now SIGNAL signal.resume_plugin_gr_stop_after_holding_plugin_running_lock";
--let $rpl_connection_name= server_1
--source include/rpl_connection.inc
--reap
--let $group_replication_member_state= OFFLINE
--source include/gr_wait_for_member_state.inc
--echo ############################################################
--echo # 5. Clean up.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET DEBUG_SYNC= 'RESET';
SET @@GLOBAL.read_only= 0;
--source include/group_replication_end.inc
|