Debian Codegraph @

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

raw
1 #
2 # Test progress output during IST
3 #
4
5 --source include/galera_cluster.inc
6
7 # Isolate node #2
8 --connection node_2
9 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
10 --source include/wait_condition.inc
11 SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
12
13 --connection node_1
14 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
15 --source include/wait_condition.inc
16
17 --connection node_2
18 SET SESSION wsrep_on = OFF;
19 --let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
20 --source include/wait_condition.inc
21 SET SESSION wsrep_on = ON;
22
23 # Node #2 is now isolated. Run some transactions to accumulate writesets for IST
24
25 --connection node_1
26 CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
27 INSERT INTO t1 VALUES (1);
28 INSERT INTO t1 VALUES (2);
29 INSERT INTO t1 VALUES (3);
30 INSERT INTO t1 VALUES (4);
31 INSERT INTO t1 VALUES (5);
32 INSERT INTO t1 VALUES (6);
33 INSERT INTO t1 VALUES (7);
34 INSERT INTO t1 VALUES (8);
35 INSERT INTO t1 VALUES (9);
36 INSERT INTO t1 VALUES (10);
37
38 # Restore node #2, IST is performed
39
40 --connection node_2
41 SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
42
43 --connection node_1
44 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
45 --source include/wait_condition.inc
46
47 --connection node_2
48 --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
49 --source include/wait_condition.inc
50
51 #
52 # sed for expected IST output in joiner log
53 #
54
55 --connection node_1
56
57 # Grep is not safe always and we are interested that there is at least one progress report (there can be more)
58 let $MYSQLD_DATADIR= `SELECT @@datadir`;
59 --echo "Trying to find IST progress reporting"
60 --exec sed -ne 's/.*Receiving IST.*/found/p' $MYSQLD_DATADIR/../../log/mysqld.2.err | tail -1
61
62 # Cleanup
63
64 --connection node_1
65 DROP TABLE t1;