summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test
blob: a87f19ac94ebde02e6aa2c5e89be7482fade7c28 (plain)
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
#
# Test the operation of evs.suspect_timeout.
#
# We set evs.inactive_timeout to a very high value so that evs.suspect_timeout can kick in instead.
#

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

--connection node_1
--let $wsrep_provider_options_node1 = `SELECT @@wsrep_provider_options`
SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S';

--connection node_2
--source include/wait_until_connected_again.inc
--let $wsrep_provider_options_node2 = `SELECT @@wsrep_provider_options`
SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S';

--let $galera_connection_name = node_3
--let $galera_server_number = 3
--source include/galera_connect.inc
--connection node_3
--source include/wait_until_connected_again.inc
--let $wsrep_cluster_address_node3 = `SELECT @@wsrep_cluster_address`

# Suspend node #3

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

# Confirm that the other nodes have booted it out

--connection node_1
--source include/wait_until_connected_again.inc
SET SESSION wsrep_sync_wait = 0;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--disable_query_log
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node1';
--enable_query_log

--source include/wait_until_connected_again.inc
CREATE TABLE t1 (f1 INTEGER);
INSERT INTO t1 VALUES (1);

--connection node_2
SET SESSION wsrep_sync_wait = 0;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--disable_query_log
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node2';
--enable_query_log

--source include/wait_until_connected_again.inc
SELECT COUNT(*) = 1 FROM t1;
DROP TABLE t1;

# Reconnect node #3 so that MTR's end-of-test checks can run

--connection node_3
--source include/galera_resume.inc
--source include/wait_until_connected_again.inc

CALL mtr.add_suppression("WSREP: gcs_caused() returned -1 \\(Operation not permitted\\)");

--disable_query_log
--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node3';
--enable_query_log
--source include/wait_until_connected_again.inc