| 1 |
# |
| 2 |
# Test a case where a vote happens in JOINED state after SST on a writeset |
| 3 |
# that should be applied. |
| 4 |
# |
| 5 |
|
| 6 |
--source galera_vote_joined_begin.inc |
| 7 |
# |
| 8 |
# At this point state snapshot has been copied, node 1 is operational and |
| 9 |
# we have about 10 seconds while everything we do will go into the replication |
| 10 |
# queue on node 4 which it will have to apply on top of the snapshot. |
| 11 |
# |
| 12 |
|
| 13 |
# Increase replication queue on node_4 |
| 14 |
--connection node_1 |
| 15 |
CALL p1(130); |
| 16 |
|
| 17 |
# Create a writeset that node 4 won't be able to apply by creating a table |
| 18 |
# that won't be present in the replication stream |
| 19 |
--connection node_1 |
| 20 |
SET SESSION wsrep_on = OFF; |
| 21 |
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY); |
| 22 |
SET SESSION wsrep_on = ON; |
| 23 |
|
| 24 |
--connection node_2 |
| 25 |
SET SESSION wsrep_on = OFF; |
| 26 |
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY); |
| 27 |
SET SESSION wsrep_on = ON; |
| 28 |
|
| 29 |
--connection node_3 |
| 30 |
SET SESSION wsrep_on = OFF; |
| 31 |
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY); |
| 32 |
SET SESSION wsrep_on = ON; |
| 33 |
|
| 34 |
# This should cause node #4 to initiate a vote and leave the cluster |
| 35 |
INSERT INTO t2 VALUES (DEFAULT); |
| 36 |
|
| 37 |
# make sure nodes 1,2,3 progress far enough for commit cut update |
| 38 |
CALL p1(130); |
| 39 |
|
| 40 |
--echo Waiting for server 4 to leave the cluster |
| 41 |
--let $members = 3 |
| 42 |
--source include/wsrep_wait_membership.inc |
| 43 |
--connection node_2 |
| 44 |
--source include/wsrep_wait_membership.inc |
| 45 |
--connection node_1 |
| 46 |
--source include/wsrep_wait_membership.inc |
| 47 |
|
| 48 |
--connection node_4 |
| 49 |
--echo Server 4 left the cluster, killing it... |
| 50 |
# Kill the connected server |
| 51 |
--exec echo "wait" > $node_4_expect_file_name |
| 52 |
--let KILL_NODE_PIDFILE = $node_4_pid_file |
| 53 |
--perl |
| 54 |
my $pid_filename = $ENV{'KILL_NODE_PIDFILE'}; |
| 55 |
my $mysqld_pid = `cat $pid_filename`; |
| 56 |
chomp($mysqld_pid); |
| 57 |
system("kill -9 $mysqld_pid"); |
| 58 |
exit(0); |
| 59 |
EOF |
| 60 |
--echo Killed server 4... |
| 61 |
--source include/wait_until_disconnected.inc |
| 62 |
--echo Restarting server 4... |
| 63 |
--source include/start_mysqld.inc |
| 64 |
--source include/galera_wait_ready.inc |
| 65 |
DROP TABLE t2; |
| 66 |
|
| 67 |
--source galera_vote_joined_end.inc |
| 68 |
|
| 69 |
--connection node_4 |
| 70 |
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table "); |
| 71 |
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146"); |
| 72 |
CALL mtr.add_suppression("Inconsistency detected: Inconsistent by consensus"); |
| 73 |
CALL mtr.add_suppression("Failed to apply write set: gtid:"); |