Debian Codegraph @

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

raw
1 ###############################################################################
2 #
3 # No configuration change can happen if one of the members is in recovery mode.
4 #
5 # Test:
6 # 0. The test requires two servers.
7 # 1. Server1 bootstrap group
8 # 2. Start server 2 that will block on recovery
9 # 3. Execute action switch to single primary that will fail due a server
10 # is blocked on recovery
11 # 4. Resume recovery on server2
12 # 5. Cleanup
13 #
14 ###############################################################################
15
16 --source include/have_debug_sync.inc
17 --source include/have_group_replication_plugin.inc
18 --let $rpl_skip_group_replication_start= 1
19 --source include/group_replication.inc
20
21 --echo
22 --echo # 1. Server1 bootstrap group
23
24 --source include/start_and_bootstrap_group_replication.inc
25
26 --let $server1_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
27
28 --echo
29 --echo # 3. Start server 2 that will block on recovery
30
31 --let $rpl_connection_name= server2
32 --source include/rpl_connection.inc
33
34 set session sql_log_bin=0;
35 call mtr.add_suppression("Error while executing a group configuration operation: A member is joining the group, wait for it to be ONLINE.");
36 set session sql_log_bin=1;
37
38 SET @@GLOBAL.DEBUG='+d,recovery_thread_wait_before_finish';
39
40 --let $group_replication_start_member_state= RECOVERING
41 --source include/start_group_replication.inc
42
43 --echo
44 --echo # 4. Execute action switch to single primary that will fail due a server
45 --echo # is blocked on recovery
46
47 --let $rpl_connection_name= server1
48 --source include/rpl_connection.inc
49
50 set session sql_log_bin=0;
51 call mtr.add_suppression("The function 'group_replication_switch_to_single_primary_mode' failed. A member is joining the group.*");
52 set session sql_log_bin=1;
53
54 --replace_result $server1_uuid MEMBER1_UUID
55 --error ER_CANT_INITIALIZE_UDF
56 --eval SELECT group_replication_switch_to_single_primary_mode("$server1_uuid")
57
58 --echo
59 --echo # 5. Resume recovery on server2
60
61 --let $rpl_connection_name= server2
62 --source include/rpl_connection.inc
63 SET DEBUG_SYNC= "now WAIT_FOR signal.recovery_thread_wait_before_finish_reached";
64 SET @@GLOBAL.DEBUG='-d,recovery_thread_wait_before_finish';
65 SET DEBUG_SYNC= "now SIGNAL signal.recovery_end";
66
67 --let $group_replication_member_state= ONLINE
68 --source include/gr_wait_for_member_state.inc
69
70 SET DEBUG_SYNC= 'RESET';
71
72 --echo
73 --echo # 6. Cleanup
74
75 --source include/group_replication_end.inc