diff options
author | Philip Stoev <philip.stoev@galeracluster.com> | 2016-03-15 03:38:31 -0700 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-08-21 16:17:06 -0400 |
commit | a00f4b29b5a50c46641fa522c2b3235fe72ae697 (patch) | |
tree | 091e0d50b911f0025c489217664e06265894779a | |
parent | b758e9238aac8d8b167621a9787b6d2dd92cb082 (diff) | |
download | mariadb-git-a00f4b29b5a50c46641fa522c2b3235fe72ae697.tar.gz |
Refs codership/galera#105 An MTR test for ist.recv_bind
-rw-r--r-- | mysql-test/suite/galera/r/galera_ist_recv_bind.result | 13 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/galera_ist_recv_bind.cnf | 8 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/galera_ist_recv_bind.test | 53 |
3 files changed, 74 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/r/galera_ist_recv_bind.result b/mysql-test/suite/galera/r/galera_ist_recv_bind.result new file mode 100644 index 00000000000..de4e07fbe41 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_ist_recv_bind.result @@ -0,0 +1,13 @@ +SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'; +@@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%' +1 +SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'; +@@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%' +1 +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; +SET SESSION wsrep_on = OFF; +SET SESSION wsrep_on = ON; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf b/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf new file mode 100644 index 00000000000..2628f05eaef --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf @@ -0,0 +1,8 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep_provider_options='base_port=@mysqld.1.#galera_port;ist.recv_bind=127.0.0.1;pc.ignore_sb=true' + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;ist.recv_bind=127.0.0.1' + diff --git a/mysql-test/suite/galera/t/galera_ist_recv_bind.test b/mysql-test/suite/galera/t/galera_ist_recv_bind.test new file mode 100644 index 00000000000..c04238d6cca --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ist_recv_bind.test @@ -0,0 +1,53 @@ +# +# Test ist.recv_bind option. Since MTR can not do proper testing with multiple interfaces and such, we +# simply confirm that the option can be set (in the galera_ist_recv_bind.cnf file) and that IST works as expected +# + +--source include/galera_cluster.inc + +--connection node_1 +SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'; + +--connection node_2 +SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'; + +# Isolate node #2 + +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_2 +SET SESSION wsrep_on = OFF; +--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc +SET SESSION wsrep_on = ON; + +# Node #2 is now isolated. Run some transactions to accumulate writesets for IST + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); + +# Restore node #2 + +--connection node_2 +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc + +# Confirm that IST has taken place + +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; +--source include/wait_condition.inc + +# Cleanup + +DROP TABLE t1; |