Debian Codegraph @

mysql-test/suite/galera/t/galera_vote_joined_skip.test

raw
1 #
2 # Test a case where a vote happens in JOINED state after SST on a writeset
3 # that should be skipped. I.e. JOINED node should continue operation.
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 #
18 # Create a writeset that node 4 won't be able to apply by making node 3
19 # inconsisitent
20 #
21 --connection node_3
22 --let $node_3_server_id= `SELECT @@server_id`
23 --let $node_3_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$node_3_server_id.expect
24 --let $node_3_pid_file= `SELECT @@pid_file`
25 SET SESSION wsrep_on = OFF;
26 CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
27 SET SESSION wsrep_on = ON;
28
29 # This should cause nodes #1 and #2 to initiate a vote and kick node #3
30 # out of the cluster, node #4 should recover the vote when fails to apply
31 # the event and continue
32 INSERT INTO t2 VALUES (DEFAULT);
33 SET SESSION wsrep_on = OFF;
34
35 # make sure nodes 1,2 progress far enough for commit cut update
36 --connection node_1
37 CALL p1(130);
38
39 --let $members = 3
40 --echo Waiting for server 3 to leave the cluster
41 --connection node_1
42 --source include/wsrep_wait_membership.inc
43 --connection node_2
44 --source include/wsrep_wait_membership.inc
45 --connection node_4
46 # need to wait for extra SST delay on joiner
47 --sleep $MTR_SST_JOINER_DELAY
48 --sleep $MTR_SST_JOINER_DELAY
49 --enable_reconnect
50 --let $wait_timeout = 60
51 --source include/wsrep_wait_membership.inc
52
53 --connection node_3
54 --echo Server 3 left the cluster, killing it...
55 # Kill the connected server
56 --exec echo "wait" > $node_3_expect_file_name
57 --let KILL_NODE_PIDFILE = $node_3_pid_file
58 --perl
59 my $pid_filename = $ENV{'KILL_NODE_PIDFILE'};
60 my $mysqld_pid = `cat $pid_filename`;
61 chomp($mysqld_pid);
62 system("kill -9 $mysqld_pid");
63 exit(0);
64 EOF
65 --echo Killed server 3.
66 --source include/wait_until_disconnected.inc
67 --echo Restarting server 3...
68 --exec echo "restart:$start_mysqld_params" > $node_3_expect_file_name
69
70 --echo Waiting for server 3 to rejoin the cluster
71 --connection node_1
72 --let $members = 3
73 --source include/wsrep_wait_membership.inc
74
75 --connection node_3
76 --echo sleeping for $MTR_SST_JOINER_DELAY
77 # need to wait for extra SST delay on joiner
78 --sleep $MTR_SST_JOINER_DELAY
79 --sleep $MTR_SST_JOINER_DELAY
80 --echo Waiting ready
81 --enable_reconnect
82 --source include/galera_wait_ready.inc
83 --echo Server 3 restarted.
84
85 --source galera_vote_joined_end.inc
86
87 --connection node_1
88 CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
89 CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
90
91 --connection node_2
92 CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
93 CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
94
95 --connection node_3
96 CALL mtr.add_suppression("Vote 0 \\(success\\) on .+ is inconsistent with group");
97
98 --connection node_4
99 CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
100 CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");