Debian Codegraph @

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

raw
1 ###############################################################################
2 #
3 # Any local failure in a configuration change that prevents its progress
4 # shall make the server leave the group (if configured to)
5 # as its configuration may have deviated from the group.
6 #
7 # Test:
8 # 0. This test requires three servers in single primary mode
9 # 1. Server1 start, bootstrap the group and create table test.t1
10 # 2. Start server2 and server3
11 # 3. Fake a stopped applier on server2
12 # 4. Change to multi primary mode
13 # 5. server2 shall fail and leave the group
14 # 6. Confirm server2 is on ERROR state
15 # 7. Cleanup
16 #
17 ###############################################################################
18
19 --source include/have_debug.inc
20 --source include/have_group_replication_plugin.inc
21 --let $rpl_server_count= 3
22 --let $rpl_skip_group_replication_start= 1
23 --let $rpl_group_replication_single_primary_mode=1
24 --source include/group_replication.inc
25
26 --echo
27 --echo # 1. Server1 start, bootstrap the group and create table test.t1
28
29 --source include/start_and_bootstrap_group_replication.inc
30
31 --echo
32 --echo # 2. Start server2 and server3
33
34 --let $rpl_connection_name= server2
35 --source include/rpl_connection.inc
36
37 set session sql_log_bin=0;
38 call mtr.add_suppression("A configuration change was killed in this member. The member will now leave the group as its configuration may have diverged.");
39 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
40 call mtr.add_suppression("Error while executing a group configuration operation: This operation ended in error as it was not possible to wait for the execution of the plugin queued transactions. The member will now leave the group.");
41 call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
42 set session sql_log_bin=1;
43
44 --source include/start_group_replication.inc
45
46 --let $rpl_connection_name= server3
47 --source include/rpl_connection.inc
48 --source include/start_group_replication.inc
49
50 --echo
51 --echo # 3. Fake a stopped applier on server2
52
53 --let $rpl_connection_name= server2
54 --source include/rpl_connection.inc
55 SET @@GLOBAL.DEBUG= '+d,group_replication_wait_for_gtid_execution_force_error';
56
57 --echo
58 --echo # 4. Change to multi primary mode
59
60 --let $rpl_connection_name= server1
61 --source include/rpl_connection.inc
62
63 SELECT group_replication_switch_to_multi_primary_mode();
64
65 --echo
66 --echo # 5. server2 shall fail and leave the group
67 --let $rpl_connection_name= server1
68 --source include/rpl_connection.inc
69
70 --let $group_replication_number_of_members= 2
71 --source include/gr_wait_for_number_of_members.inc
72
73 --echo
74 --echo # 6. Confirm server2 is on ERROR state
75
76 --let $rpl_connection_name= server2
77 --source include/rpl_connection.inc
78
79 --let $group_replication_member_state= ERROR
80 --source include/gr_wait_for_member_state.inc
81
82 SET @@GLOBAL.DEBUG= '-d,group_replication_wait_for_gtid_execution_force_error';
83
84 --echo
85 --echo # 7. Cleanup
86
87 --let $rpl_group_replication_reset_persistent_vars=1
88 --let $rpl_group_replication_single_primary_mode=1
89 --source include/group_replication_end.inc