Debian Codegraph @

mysql-test/suite/group_replication/t/gr_change_member_actions_during_stop.test

raw
1 ################################################################################
2 # This test verifies that parallel execution of STOP GROUP_REPLICATION and
3 # Group Replication member actions change are handled properly by the server.
4 #
5 # Test:
6 # 0. The test requires one server: M1
7 # 1. Bootstrap a group on server1.
8 # Setup a debug point that will block a future
9 # STOP GROUP_REPLICATION command
10 # after the plugin_running_lock is acquired.
11 # 2. Asynchronously execute STOP GROUP_REPLICATION command.
12 # 3. Try to change Group Replication member actions while a
13 # STOP GROUP_REPLICATION is ongoing, they must fail.
14 # 4. Resume the STOP GROUP_REPLICATION command.
15 # 5. Clean up.
16 ################################################################################
17 --source include/have_debug.inc
18 --source include/have_debug_sync.inc
19 --source include/have_group_replication_plugin.inc
20 --let $rpl_skip_group_replication_start= 1
21 --source include/group_replication.inc
22
23
24 --echo ############################################################
25 --echo # 1. Bootstrap a group on server1.
26 --echo # Setup a debug point that will block a future
27 --echo # STOP GROUP_REPLICATION command
28 --echo # after the plugin_running_lock is acquired.
29 --let $rpl_connection_name= server1
30 --source include/rpl_connection.inc
31 --source include/start_and_bootstrap_group_replication.inc
32 SET @@GLOBAL.DEBUG='+d,gr_plugin_gr_stop_after_holding_plugin_running_lock';
33
34
35 --echo ############################################################
36 --echo # 2. Asynchronously execute STOP GROUP_REPLICATION command.
37 --let $rpl_connection_name= server_1
38 --source include/rpl_connection.inc
39 --send STOP GROUP_REPLICATION
40
41 --let $rpl_connection_name= server1
42 --source include/rpl_connection.inc
43 SET DEBUG_SYNC= "now WAIT_FOR signal.reached_plugin_gr_stop_after_holding_plugin_running_lock";
44 SET @@GLOBAL.DEBUG='-d,gr_plugin_gr_stop_after_holding_plugin_running_lock';
45
46
47 --echo ############################################################
48 --echo # 3. Try to change Group Replication member actions while a
49 --echo # STOP GROUP_REPLICATION is ongoing, they must fail.
50 --let $rpl_connection_name= server1
51 --source include/rpl_connection.inc
52 --error ER_GRP_RPL_UDF_ERROR
53 SELECT group_replication_reset_member_actions();
54
55 --error ER_GRP_RPL_UDF_ERROR
56 SELECT group_replication_enable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION");
57
58 --error ER_GRP_RPL_UDF_ERROR
59 SELECT group_replication_disable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION");
60
61 --let $assert_text= The version of replication_group_member_actions must be 1
62 --let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_group_member_actions\', version, 1] = 1
63 --source include/assert.inc
64
65
66 --echo ############################################################
67 --echo # 4. Resume the STOP GROUP_REPLICATION command.
68 --let $rpl_connection_name= server1
69 --source include/rpl_connection.inc
70 SET DEBUG_SYNC= "now SIGNAL signal.resume_plugin_gr_stop_after_holding_plugin_running_lock";
71
72 --let $rpl_connection_name= server_1
73 --source include/rpl_connection.inc
74 --reap
75
76 --let $group_replication_member_state= OFFLINE
77 --source include/gr_wait_for_member_state.inc
78
79
80 --echo ############################################################
81 --echo # 5. Clean up.
82 --let $rpl_connection_name= server1
83 --source include/rpl_connection.inc
84 SET DEBUG_SYNC= 'RESET';
85 SET @@GLOBAL.read_only= 0;
86
87 --source include/group_replication_end.inc