Skip to content

Commit a00f4b2

Browse files
philip-galeraNirbhay Choubey
authored andcommitted
Refs codership/galera#105 An MTR test for ist.recv_bind
1 parent b758e92 commit a00f4b2

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
2+
@@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'
3+
1
4+
SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
5+
@@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'
6+
1
7+
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
8+
SET SESSION wsrep_on = OFF;
9+
SET SESSION wsrep_on = ON;
10+
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
11+
INSERT INTO t1 VALUES (1);
12+
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
13+
DROP TABLE t1;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
!include ../galera_2nodes.cnf
2+
3+
[mysqld.1]
4+
wsrep_provider_options='base_port=@mysqld.1.#galera_port;ist.recv_bind=127.0.0.1;pc.ignore_sb=true'
5+
6+
[mysqld.2]
7+
wsrep_provider_options='base_port=@mysqld.2.#galera_port;ist.recv_bind=127.0.0.1'
8+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
8+
--connection node_1
9+
SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
10+
11+
--connection node_2
12+
SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%';
13+
14+
# Isolate node #2
15+
16+
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
17+
--connection node_1
18+
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
19+
--source include/wait_condition.inc
20+
21+
--connection node_2
22+
SET SESSION wsrep_on = OFF;
23+
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
24+
--source include/wait_condition.inc
25+
SET SESSION wsrep_on = ON;
26+
27+
# Node #2 is now isolated. Run some transactions to accumulate writesets for IST
28+
29+
--connection node_1
30+
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
31+
INSERT INTO t1 VALUES (1);
32+
33+
# Restore node #2
34+
35+
--connection node_2
36+
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
37+
38+
--connection node_1
39+
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
40+
--source include/wait_condition.inc
41+
42+
--connection node_2
43+
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
44+
--source include/wait_condition.inc
45+
46+
# Confirm that IST has taken place
47+
48+
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
49+
--source include/wait_condition.inc
50+
51+
# Cleanup
52+
53+
DROP TABLE t1;

0 commit comments

Comments
 (0)