| 1 |
############################################################################### |
| 2 |
# |
| 3 |
# On a blocked group if a member executes a new view with wrong parameters it |
| 4 |
# cannot block shutdown of server. |
| 5 |
# |
| 6 |
# Test: |
| 7 |
# 0. The test requires two serves |
| 8 |
# 1. Force expel of member 2 |
| 9 |
# 2. Confirm member1 sees member2 as unreachable |
| 10 |
# 3. A new view with wrong parameters will fail |
| 11 |
# 4. Shutdown server to confirm server isn't locked waiting for view |
| 12 |
# 5. Cleanup |
| 13 |
# |
| 14 |
############################################################################### |
| 15 |
|
| 16 |
# Test involves sending SIGSTOP and SIGCONT signals using kill Linux command. |
| 17 |
--source include/linux.inc |
| 18 |
--source include/big_test.inc |
| 19 |
--source include/have_group_replication_plugin.inc |
| 20 |
--source include/group_replication.inc |
| 21 |
|
| 22 |
--echo |
| 23 |
--echo # 1. Force expel of member 2 |
| 24 |
|
| 25 |
--let $rpl_connection_name= server2 |
| 26 |
--source include/rpl_connection.inc |
| 27 |
|
| 28 |
--let $member2_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1) |
| 29 |
|
| 30 |
# Then we send a SIGSTOP to it. This will stop the server from sending the |
| 31 |
# keep-alive message and thus it will be viewed as a faulty node by the rest of |
| 32 |
# the group (and consequently expelled). |
| 33 |
|
| 34 |
SET SESSION sql_log_bin = 0; |
| 35 |
CREATE TABLE pid_table(pid_no INT PRIMARY KEY); |
| 36 |
--let $pid_file=`SELECT @@pid_file` |
| 37 |
--replace_result $pid_file pid_file |
| 38 |
--eval LOAD DATA LOCAL INFILE '$pid_file' INTO TABLE pid_table |
| 39 |
--let $server_pid=`SELECT pid_no FROM pid_table` |
| 40 |
DROP TABLE pid_table; |
| 41 |
SET SESSION sql_log_bin = 1; |
| 42 |
|
| 43 |
--exec kill -19 $server_pid |
| 44 |
|
| 45 |
--echo |
| 46 |
--echo # 2. Confirm member1 sees member2 as unreachable |
| 47 |
|
| 48 |
--let $rpl_connection_name= server1 |
| 49 |
--source include/rpl_connection.inc |
| 50 |
|
| 51 |
--let $group_replication_member_state= UNREACHABLE |
| 52 |
--let $group_replication_member_id= $member2_uuid |
| 53 |
--source include/gr_wait_for_member_state.inc |
| 54 |
|
| 55 |
--echo |
| 56 |
--echo # 3. A new view with wrong parameters will fail |
| 57 |
|
| 58 |
--error ER_GROUP_REPLICATION_FORCE_MEMBERS_COMMAND_FAILURE |
| 59 |
--eval SET GLOBAL group_replication_force_members= "127.0.0.1:10000" |
| 60 |
|
| 61 |
--echo |
| 62 |
--echo # 4. Shutdown server to confirm server isn't locked waiting for view |
| 63 |
|
| 64 |
SHUTDOWN; |
| 65 |
--source include/wait_until_disconnected.inc |
| 66 |
|
| 67 |
--echo |
| 68 |
--echo # 5. Cleanup |
| 69 |
|
| 70 |
# Restart server1 |
| 71 |
--enable_reconnect |
| 72 |
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 73 |
|
| 74 |
--source include/wait_until_connected_again.inc |
| 75 |
--disable_reconnect |
| 76 |
|
| 77 |
--let $rpl_server_number= 1 |
| 78 |
--source include/rpl_reconnect.inc |
| 79 |
|
| 80 |
# Send SIGCONT to server, so it can continue. |
| 81 |
--let $rpl_connection_name= server2 |
| 82 |
--source include/rpl_connection.inc |
| 83 |
|
| 84 |
--exec kill -18 $server_pid |
| 85 |
|
| 86 |
--let $rpl_connection_name= server1 |
| 87 |
--source include/rpl_connection.inc |
| 88 |
|
| 89 |
set session sql_log_bin=0; |
| 90 |
call mtr.add_suppression("The peer is trying to set up a configuration where there are members that don't belong to the current view."); |
| 91 |
call mtr.add_suppression("Error setting group_replication_force_members value '127.0.0.1:10000' on group communication interfaces"); |
| 92 |
call mtr.add_suppression("Timeout while waiting for the group communication engine to exit!"); |
| 93 |
call mtr.add_suppression("The member has failed to gracefully leave the group."); |
| 94 |
set session sql_log_bin=1; |
| 95 |
|
| 96 |
--let $rpl_connection_name= server2 |
| 97 |
--source include/rpl_connection.inc |
| 98 |
|
| 99 |
set session sql_log_bin=0; |
| 100 |
call mtr.add_suppression("Timeout while waiting for the group communication engine to exit!"); |
| 101 |
call mtr.add_suppression("The member has failed to gracefully leave the group."); |
| 102 |
set session sql_log_bin=1; |
| 103 |
|
| 104 |
--source include/group_replication_end.inc |