summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera/t/galera_ist_progress.test
blob: 3d7c53bd1eb37a494001b01c163c9a633a92591c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# Test progress output during IST
#

--source include/galera_cluster.inc
# This could cause out of storage if run /dev/shm
--source include/big_test.inc
--source include/force_restart.inc

# Isolate node #2 
--connection 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);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (7);
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (9);
INSERT INTO t1 VALUES (10);

# Restore node #2, IST is performed

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

#
# Grep for expected IST output in joiner log
#

--connection node_1

--let $assert_count = 1
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
--let $assert_only_after = Need state transfer

--let $assert_text = Receiving IST: 13 writesets, seqnos 3-15
--let $assert_select = Receiving IST: 13 writesets, seqnos 3-15
--source include/assert_grep.inc

--let $assert_text = Receiving IST\.\.\.  0\.0% \( 0/13 events\) complete
--let $assert_select = Receiving IST\.\.\.  0\.0% \( 0/13 events\) complete
--source include/assert_grep.inc

--let $assert_text = Receiving IST\.\.\.100\.0% \(13/13 events\) complete
--let $assert_select = Receiving IST\.\.\.100\.0% \(13/13 events\) complete
--source include/assert_grep.inc

# Cleanup

--connection node_1
DROP TABLE t1;