|
| 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