File: galera_wan_restart_sst.test

package info (click to toggle)
mariadb-10.1 10.1.45-0%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 476,916 kB
  • sloc: cpp: 1,124,656; ansic: 871,843; perl: 52,917; sh: 40,078; pascal: 35,370; javascript: 15,555; yacc: 14,728; ruby: 8,684; xml: 5,377; sql: 3,490; makefile: 2,934; python: 1,970; java: 1,691; asm: 837; lex: 757; php: 22; sed: 16
file content (149 lines) | stat: -rw-r--r-- 3,847 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#
# Test that even after multiple restarts in a WAN context with two segments, the cluster continues to operate correctly.
#
# We can not easily restart the first node, so instead we restart all the other nodes. MTR does not allow multiple nodes
# to be down at the same time, so restarts are sequential.
#
# We can not test any of the actual WAN optimizations from inside MTR and no 
# status variables are provided. So we only check that simple replication works.
#

--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc

SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';

--connection node_1
CREATE TABLE t1 (f1 INTEGER);
INSERT INTO t1 VALUES (1);

--connection node_2
INSERT INTO t1 VALUES (2);

--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
INSERT INTO t1 VALUES (3);

--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
--connection node_4
INSERT INTO t1 VALUES (4);

#
# Restart node #3
#

--connection node_3
INSERT INTO t1 VALUES (13);

--source include/kill_galera.inc
--sleep 5

--connection node_1
--source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (11);

--connection node_2
INSERT INTO t1 VALUES (12);

--connection node_4
INSERT INTO t1 VALUES (14);

--connection node_3
--source include/start_mysqld.inc
--sleep 5
--source include/wait_until_connected_again.inc

INSERT INTO t1 VALUES (131);

#
# Restart node #2
#

--connection node_2
INSERT INTO t1 VALUES (22);

--source include/kill_galera.inc
--sleep 5

--connection node_1
--source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (21);

--connection node_3
INSERT INTO t1 VALUES (23);

--connection node_4
INSERT INTO t1 VALUES (24);

--connection node_2
--source include/start_mysqld.inc
--sleep 5
--source include/wait_until_connected_again.inc

INSERT INTO t1 VALUES (221);

#
# Restart node #4
#

--connection node_4
INSERT INTO t1 VALUES (34);

--source include/kill_galera.inc
--sleep 5

--connection node_1
--source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (31);

--connection node_2
INSERT INTO t1 VALUES (32);

--connection node_3
INSERT INTO t1 VALUES (33);

--connection node_4
--source include/start_mysqld.inc
--sleep 5
--source include/wait_until_connected_again.inc

INSERT INTO t1 VALUES (341);


#
# Check all nodes
#

--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc

SELECT COUNT(*) = 19 FROM t1;

--connection node_2
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT COUNT(*) = 19 FROM t1;

--connection node_3
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT COUNT(*) = 19 FROM t1;

--connection node_4
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT COUNT(*) = 19 FROM t1;

--connection node_1
DROP TABLE t1;
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
CALL mtr.add_suppression("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");

--connection node_2
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");

--connection node_3
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");

--connection node_4
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");