| 1 |
connection node_2; |
| 2 |
connection node_1; |
| 3 |
connection node_1; |
| 4 |
connection node_2; |
| 5 |
Performing State Transfer on a server that has been shut down cleanly and restarted |
| 6 |
connection node_1; |
| 7 |
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
| 8 |
SET AUTOCOMMIT=OFF; |
| 9 |
START TRANSACTION; |
| 10 |
INSERT INTO t1 VALUES (1,'node1_committed_before'); |
| 11 |
INSERT INTO t1 VALUES (2,'node1_committed_before'); |
| 12 |
INSERT INTO t1 VALUES (3,'node1_committed_before'); |
| 13 |
INSERT INTO t1 VALUES (4,'node1_committed_before'); |
| 14 |
INSERT INTO t1 VALUES (5,'node1_committed_before'); |
| 15 |
COMMIT; |
| 16 |
connection node_2; |
| 17 |
SET AUTOCOMMIT=OFF; |
| 18 |
START TRANSACTION; |
| 19 |
INSERT INTO t1 VALUES (6,'node2_committed_before'); |
| 20 |
INSERT INTO t1 VALUES (7,'node2_committed_before'); |
| 21 |
INSERT INTO t1 VALUES (8,'node2_committed_before'); |
| 22 |
INSERT INTO t1 VALUES (9,'node2_committed_before'); |
| 23 |
INSERT INTO t1 VALUES (10,'node2_committed_before'); |
| 24 |
COMMIT; |
| 25 |
Shutting down server ... |
| 26 |
connection node_1; |
| 27 |
SET AUTOCOMMIT=OFF; |
| 28 |
START TRANSACTION; |
| 29 |
INSERT INTO t1 VALUES (11,'node1_committed_during'); |
| 30 |
INSERT INTO t1 VALUES (12,'node1_committed_during'); |
| 31 |
INSERT INTO t1 VALUES (13,'node1_committed_during'); |
| 32 |
INSERT INTO t1 VALUES (14,'node1_committed_during'); |
| 33 |
INSERT INTO t1 VALUES (15,'node1_committed_during'); |
| 34 |
COMMIT; |
| 35 |
START TRANSACTION; |
| 36 |
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); |
| 37 |
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); |
| 38 |
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); |
| 39 |
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); |
| 40 |
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); |
| 41 |
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
| 42 |
SET AUTOCOMMIT=OFF; |
| 43 |
START TRANSACTION; |
| 44 |
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); |
| 45 |
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); |
| 46 |
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); |
| 47 |
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); |
| 48 |
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); |
| 49 |
connection node_2; |
| 50 |
Starting server ... |
| 51 |
SET AUTOCOMMIT=OFF; |
| 52 |
START TRANSACTION; |
| 53 |
INSERT INTO t1 VALUES (26,'node2_committed_after'); |
| 54 |
INSERT INTO t1 VALUES (27,'node2_committed_after'); |
| 55 |
INSERT INTO t1 VALUES (28,'node2_committed_after'); |
| 56 |
INSERT INTO t1 VALUES (29,'node2_committed_after'); |
| 57 |
INSERT INTO t1 VALUES (30,'node2_committed_after'); |
| 58 |
COMMIT; |
| 59 |
connection node_1; |
| 60 |
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); |
| 61 |
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); |
| 62 |
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); |
| 63 |
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); |
| 64 |
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); |
| 65 |
COMMIT; |
| 66 |
SET AUTOCOMMIT=OFF; |
| 67 |
START TRANSACTION; |
| 68 |
INSERT INTO t1 VALUES (36,'node1_committed_after'); |
| 69 |
INSERT INTO t1 VALUES (37,'node1_committed_after'); |
| 70 |
INSERT INTO t1 VALUES (38,'node1_committed_after'); |
| 71 |
INSERT INTO t1 VALUES (39,'node1_committed_after'); |
| 72 |
INSERT INTO t1 VALUES (40,'node1_committed_after'); |
| 73 |
COMMIT; |
| 74 |
connection node_1a_galera_st_shutdown_slave; |
| 75 |
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); |
| 76 |
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); |
| 77 |
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); |
| 78 |
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); |
| 79 |
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); |
| 80 |
ROLLBACK; |
| 81 |
SET AUTOCOMMIT=ON; |
| 82 |
SET SESSION wsrep_sync_wait=15; |
| 83 |
SELECT COUNT(*) AS EXPECT_15 FROM t1; |
| 84 |
EXPECT_15 |
| 85 |
35 |
| 86 |
SELECT * from t1; |
| 87 |
id f1 |
| 88 |
1 node1_committed_before |
| 89 |
2 node1_committed_before |
| 90 |
3 node1_committed_before |
| 91 |
4 node1_committed_before |
| 92 |
5 node1_committed_before |
| 93 |
6 node2_committed_before |
| 94 |
7 node2_committed_before |
| 95 |
8 node2_committed_before |
| 96 |
9 node2_committed_before |
| 97 |
10 node2_committed_before |
| 98 |
11 node1_committed_during |
| 99 |
12 node1_committed_during |
| 100 |
13 node1_committed_during |
| 101 |
14 node1_committed_during |
| 102 |
15 node1_committed_during |
| 103 |
16 node1_to_be_committed_after |
| 104 |
17 node1_to_be_committed_after |
| 105 |
18 node1_to_be_committed_after |
| 106 |
19 node1_to_be_committed_after |
| 107 |
20 node1_to_be_committed_after |
| 108 |
26 node2_committed_after |
| 109 |
27 node2_committed_after |
| 110 |
28 node2_committed_after |
| 111 |
29 node2_committed_after |
| 112 |
30 node2_committed_after |
| 113 |
31 node1_to_be_committed_after |
| 114 |
32 node1_to_be_committed_after |
| 115 |
33 node1_to_be_committed_after |
| 116 |
34 node1_to_be_committed_after |
| 117 |
35 node1_to_be_committed_after |
| 118 |
36 node1_committed_after |
| 119 |
37 node1_committed_after |
| 120 |
38 node1_committed_after |
| 121 |
39 node1_committed_after |
| 122 |
40 node1_committed_after |
| 123 |
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
| 124 |
COUNT(*) = 0 |
| 125 |
1 |
| 126 |
COMMIT; |
| 127 |
connection node_1; |
| 128 |
SET AUTOCOMMIT=ON; |
| 129 |
SET SESSION wsrep_sync_wait=15; |
| 130 |
SELECT COUNT(*) AS EXPECT_15 FROM t1; |
| 131 |
EXPECT_15 |
| 132 |
35 |
| 133 |
SELECT * from t1; |
| 134 |
id f1 |
| 135 |
1 node1_committed_before |
| 136 |
2 node1_committed_before |
| 137 |
3 node1_committed_before |
| 138 |
4 node1_committed_before |
| 139 |
5 node1_committed_before |
| 140 |
6 node2_committed_before |
| 141 |
7 node2_committed_before |
| 142 |
8 node2_committed_before |
| 143 |
9 node2_committed_before |
| 144 |
10 node2_committed_before |
| 145 |
11 node1_committed_during |
| 146 |
12 node1_committed_during |
| 147 |
13 node1_committed_during |
| 148 |
14 node1_committed_during |
| 149 |
15 node1_committed_during |
| 150 |
16 node1_to_be_committed_after |
| 151 |
17 node1_to_be_committed_after |
| 152 |
18 node1_to_be_committed_after |
| 153 |
19 node1_to_be_committed_after |
| 154 |
20 node1_to_be_committed_after |
| 155 |
26 node2_committed_after |
| 156 |
27 node2_committed_after |
| 157 |
28 node2_committed_after |
| 158 |
29 node2_committed_after |
| 159 |
30 node2_committed_after |
| 160 |
31 node1_to_be_committed_after |
| 161 |
32 node1_to_be_committed_after |
| 162 |
33 node1_to_be_committed_after |
| 163 |
34 node1_to_be_committed_after |
| 164 |
35 node1_to_be_committed_after |
| 165 |
36 node1_committed_after |
| 166 |
37 node1_committed_after |
| 167 |
38 node1_committed_after |
| 168 |
39 node1_committed_after |
| 169 |
40 node1_committed_after |
| 170 |
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
| 171 |
COUNT(*) = 0 |
| 172 |
1 |
| 173 |
DROP TABLE t1; |
| 174 |
COMMIT; |