Debian Codegraph @

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

raw
1 ###############################################################################
2 #
3 # Any local failure in a configuration change that prevents its progress
4 # shall make the server abort (if configured to) as its
5 # configuration may have deviated from the group.
6 #
7 # Test:
8 # 0. This test requires three servers in single primary mode
9 # 1. Start the servers, server 2 is configured to abort
10 # 2. Fake a stopped applier in server2
11 # 3. Change to multi primary mode
12 # 4. Server2 shall abort and 'exit' the group
13 # 5. Wait for server 2 to disconnect/abort and restart
14 # 6. Cleanup
15 #
16 ###############################################################################
17
18 --source include/have_debug.inc
19 --source include/not_valgrind.inc
20 --source include/big_test.inc
21 --source include/have_group_replication_plugin.inc
22 --let $rpl_server_count= 3
23 --let $rpl_skip_group_replication_start= 1
24 --let $rpl_group_replication_single_primary_mode=1
25 --source include/group_replication.inc
26
27 --echo
28 --echo # 1. Start the servers, server 2 is configured to abort
29
30 --source include/start_and_bootstrap_group_replication.inc
31
32 --let $rpl_connection_name= server2
33 --source include/rpl_connection.inc
34
35 set session sql_log_bin=0;
36 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.");
37 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
38 call mtr.add_suppression("The plugin encountered a critical error and will abort: Fatal error during a Group Replication configuration change. *");
39 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");
40
41 set session sql_log_bin=1;
42
43 SET @@GLOBAL.group_replication_exit_state_action = ABORT_SERVER;
44
45 --source include/start_group_replication.inc
46
47 --let $rpl_connection_name= server3
48 --source include/rpl_connection.inc
49 --source include/start_group_replication.inc
50
51 --echo
52 --echo # 2. Fake a stopped applier in server2
53
54 --let $rpl_connection_name= server2
55 --source include/rpl_connection.inc
56 SET @@GLOBAL.DEBUG= '+d,group_replication_wait_for_gtid_execution_force_error';
57
58 # Inform MTR that we are expecting an abort and that it should wait before
59 # restarting the aborting member
60 --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
61
62 --echo
63 --echo # 3. Change to multi primary mode
64
65 --let $rpl_connection_name= server1
66 --source include/rpl_connection.inc
67
68 SELECT group_replication_switch_to_multi_primary_mode();
69
70 --echo
71 --echo # 4. Server2 shall abort and 'exit' the group
72 --let $rpl_connection_name= server1
73 --source include/rpl_connection.inc
74
75 --let $group_replication_number_of_members= 2
76 --source include/gr_wait_for_number_of_members.inc
77
78 --echo
79 --echo # 5. Wait for server 2 to disconnect/abort and restart
80
81 --let $rpl_connection_name= server2
82 --source include/rpl_connection.inc
83 --source include/wait_until_disconnected.inc
84 # Inform MTR that it should restart the aborted member
85 --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
86 --let $rpl_server_number= 2
87 --source include/rpl_reconnect.inc
88 SET @@GLOBAL.DEBUG= '-d,group_replication_wait_for_gtid_execution_force_error';
89
90 --echo
91 --echo # 6. Cleanup
92
93 --let $rpl_group_replication_reset_persistent_vars=1
94 --let $rpl_group_replication_single_primary_mode=1
95 --source include/group_replication_end.inc