Debian Codegraph @

mysql-test/suite/galera_3nodes/t/galera_garbd.test

raw
1 #
2 # A very basic test for the galera arbitrator. We shut down node #3 and use its port allocation to start garbd.
3 # As MTR does not allow multiple servers to be down at the same time, we are limited as to what we can test.
4 #
5
6 --source include/galera_cluster.inc
7 --source include/have_innodb.inc
8 --source include/have_garbd.inc
9 --source include/big_test.inc
10
11 # Save galera ports
12 --source suite/galera/include/galera_base_port.inc
13 --let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT
14
15 --let $galera_connection_name = node_3
16 --let $galera_server_number = 3
17 --source include/galera_connect.inc
18 --source suite/galera/include/galera_base_port.inc
19 --let $NODE_GALERAPORT_3 = $_NODE_GALERAPORT
20
21 # Save original auto_increment_offset values.
22 --let $node_1=node_1
23 --let $node_2=node_2
24 --let $node_3=node_3
25 --source ../galera/include/auto_increment_offset_save.inc
26
27 --echo Killing node #3 to free ports for garbd ...
28 --connection node_3
29 --source include/shutdown_mysqld.inc
30
31 --connection node_1
32 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
33 --source include/wait_condition.inc
34
35 --echo Starting garbd ...
36 --exec $MTR_GARBD_EXE --address "gcomm://127.0.0.1:$NODE_GALERAPORT_1" --group my_wsrep_cluster --options 'base_port=$NODE_GALERAPORT_3' > $MYSQL_TMP_DIR/garbd.log 2>&1 &
37
38 --sleep 5
39
40 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
41 --source include/wait_condition.inc
42
43 CREATE TABLE t1 (f1 INTEGER);
44 INSERT INTO t1 VALUES (1);
45
46 --connection node_2
47 SELECT COUNT(*) = 1 FROM t1;
48
49 --echo Killing garbd ...
50 # FreeBSD's /bin/pkill only supports short versions of the options:
51 # -o Select only the oldest (least recently started)
52 # -f Match against full argument lists
53 --exec pkill -o -f garbd.*$NODE_GALERAPORT_3
54
55 --sleep 5
56
57 --connection node_1
58 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
59 --source include/wait_condition.inc
60
61 INSERT INTO t1 VALUES (2);
62
63 --connection node_2
64 SELECT COUNT(*) = 2 FROM t1;
65
66 DROP TABLE t1;
67
68 --echo Restarting node #3 to satisfy MTR's end-of-test checks
69 --connection node_3
70 let $restart_noprint=2;
71 --source include/start_mysqld.inc
72
73 # Restore original auto_increment_offset values.
74 --source ../galera/include/auto_increment_offset_restore.inc
75
76 # Workaround for galera#101
77
78 --connection node_1
79 CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
80
81 --connection node_2
82 CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
83
84 --connection node_3
85 CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");