Debian Codegraph @

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

raw
1 ################################################################################
2 # This test proves 2 instances of START and STOP GROUP_REPLICATION cannot be
3 # executed in parallel.
4 #
5 # Test:
6 # 0. The test requires two servers: M1 and M2.
7 # 1. Bootstrap M1.
8 # 2. Set parameters for server 2 for start gr.
9 # 3. Check parallel START/STOP GR is blocked if START GR is running.
10 # 4. Check parallel START/STOP GR is blocked if STOP GR is running.
11 # 5. Cleanup.
12 ################################################################################
13
14 --source include/have_debug_sync.inc
15 --source include/have_group_replication_plugin.inc
16 --let $rpl_skip_group_replication_start= 1
17 --source include/group_replication.inc
18
19 --echo
20 --echo # 1. Bootstrap M1.
21 --let $rpl_connection_name= server1
22 --source include/rpl_connection.inc
23 --source include/start_and_bootstrap_group_replication.inc
24
25 --echo
26 --echo # 2. Set parameters for server 2 for start gr.
27
28 --let $rpl_connection_name= server2
29 --source include/rpl_connection.inc
30
31 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
32 --eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
33
34 SET @debug_save= @@GLOBAL.DEBUG;
35
36 --echo
37 --echo # 3. Check parallel START/STOP GR is blocked if START GR is running.
38
39
40 SET @@GLOBAL.DEBUG='+d,group_replication_wait_on_start';
41
42 --send START GROUP_REPLICATION;
43
44 --let $rpl_connection_name= server_2_1
45 --source include/rpl_connection.inc
46
47 SET DEBUG_SYNC='now wait_for signal.start_waiting';
48
49 --error ER_GROUP_REPLICATION_COMMAND_FAILURE
50 START GROUP_REPLICATION;
51
52 --error ER_GROUP_REPLICATION_COMMAND_FAILURE
53 STOP GROUP_REPLICATION;
54 SET DEBUG_SYNC='now signal signal.start_continue';
55
56 --let $rpl_connection_name= server2
57 --source include/rpl_connection.inc
58 --reap
59
60 --let $group_replication_member_state = ONLINE
61 --source include/gr_wait_for_member_state.inc
62
63 --echo
64 --echo # 4. Check parallel START/STOP GR is blocked if STOP GR is running.
65
66 SET @@GLOBAL.DEBUG='+d,group_replication_hold_stop_before_leave_the_group';
67
68 --send STOP GROUP_REPLICATION;
69
70 --let $rpl_connection_name= server_2_1
71 --source include/rpl_connection.inc
72
73 SET DEBUG_SYNC='now wait_for signal.stopping_before_leave_the_group';
74
75 --error ER_GROUP_REPLICATION_COMMAND_FAILURE
76 START GROUP_REPLICATION;
77
78 --error ER_GROUP_REPLICATION_COMMAND_FAILURE
79 STOP GROUP_REPLICATION;
80
81 SET DEBUG_SYNC='now signal signal.resume_stop_before_leave_the_group';
82
83 --let $rpl_connection_name= server2
84 --source include/rpl_connection.inc
85 --reap
86
87 --let $group_replication_member_state = OFFLINE
88 --source include/gr_wait_for_member_state.inc
89
90 --echo
91 --echo # 5. Cleanup.
92
93 SET @@GLOBAL.DEBUG= @debug_save;
94
95 --source include/group_replication_end.inc