Debian Codegraph @

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

raw
1 #
2 # Test ist.recv_bind option. Since MTR can not do proper testing with multiple interfaces and such, we
3 # simply confirm that the option can be set (in the galera_ist_recv_bind.cnf file) and that IST works as expected
4 #
5
6 --source include/galera_cluster.inc
7 --source include/have_innodb.inc
8 --source include/big_test.inc
9
10 --connection node_1
11 SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
12
13 --connection node_2
14 SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
15
16 # Isolate node #2
17
18 SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
19 --connection node_1
20 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
21 --source include/wait_condition.inc
22
23 --connection node_2
24 SET SESSION wsrep_on = OFF;
25 --let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
26 --source include/wait_condition.inc
27 SET SESSION wsrep_on = ON;
28
29 # Node #2 is now isolated. Run some transactions to accumulate writesets for IST
30
31 --connection node_1
32 CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
33 INSERT INTO t1 VALUES (1);
34
35 # Restore node #2
36
37 --connection node_2
38 SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
39
40 --connection node_1
41 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
42 --source include/wait_condition.inc
43
44 --connection node_2
45 --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
46 --source include/wait_condition.inc
47
48 # Confirm that IST has taken place
49
50 --let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
51 --source include/wait_condition.inc
52
53 # Cleanup
54
55 DROP TABLE t1;