| 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; |
| 175 |
Performing State Transfer on a server that starts from a clean var directory |
| 176 |
This is accomplished by shutting down node #2 and removing its var directory before restarting it |
| 177 |
connection node_1; |
| 178 |
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
| 179 |
SET AUTOCOMMIT=OFF; |
| 180 |
START TRANSACTION; |
| 181 |
INSERT INTO t1 VALUES (1,'node1_committed_before'); |
| 182 |
INSERT INTO t1 VALUES (2,'node1_committed_before'); |
| 183 |
INSERT INTO t1 VALUES (3,'node1_committed_before'); |
| 184 |
INSERT INTO t1 VALUES (4,'node1_committed_before'); |
| 185 |
INSERT INTO t1 VALUES (5,'node1_committed_before'); |
| 186 |
COMMIT; |
| 187 |
connection node_2; |
| 188 |
SET AUTOCOMMIT=OFF; |
| 189 |
START TRANSACTION; |
| 190 |
INSERT INTO t1 VALUES (6,'node2_committed_before'); |
| 191 |
INSERT INTO t1 VALUES (7,'node2_committed_before'); |
| 192 |
INSERT INTO t1 VALUES (8,'node2_committed_before'); |
| 193 |
INSERT INTO t1 VALUES (9,'node2_committed_before'); |
| 194 |
INSERT INTO t1 VALUES (10,'node2_committed_before'); |
| 195 |
COMMIT; |
| 196 |
Shutting down server ... |
| 197 |
connection node_1; |
| 198 |
Cleaning var directory ... |
| 199 |
SET AUTOCOMMIT=OFF; |
| 200 |
START TRANSACTION; |
| 201 |
INSERT INTO t1 VALUES (11,'node1_committed_during'); |
| 202 |
INSERT INTO t1 VALUES (12,'node1_committed_during'); |
| 203 |
INSERT INTO t1 VALUES (13,'node1_committed_during'); |
| 204 |
INSERT INTO t1 VALUES (14,'node1_committed_during'); |
| 205 |
INSERT INTO t1 VALUES (15,'node1_committed_during'); |
| 206 |
COMMIT; |
| 207 |
START TRANSACTION; |
| 208 |
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); |
| 209 |
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); |
| 210 |
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); |
| 211 |
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); |
| 212 |
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); |
| 213 |
connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
| 214 |
SET AUTOCOMMIT=OFF; |
| 215 |
START TRANSACTION; |
| 216 |
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); |
| 217 |
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); |
| 218 |
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); |
| 219 |
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); |
| 220 |
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); |
| 221 |
connection node_2; |
| 222 |
Starting server ... |
| 223 |
SET AUTOCOMMIT=OFF; |
| 224 |
START TRANSACTION; |
| 225 |
INSERT INTO t1 VALUES (26,'node2_committed_after'); |
| 226 |
INSERT INTO t1 VALUES (27,'node2_committed_after'); |
| 227 |
INSERT INTO t1 VALUES (28,'node2_committed_after'); |
| 228 |
INSERT INTO t1 VALUES (29,'node2_committed_after'); |
| 229 |
INSERT INTO t1 VALUES (30,'node2_committed_after'); |
| 230 |
COMMIT; |
| 231 |
connection node_1; |
| 232 |
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); |
| 233 |
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); |
| 234 |
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); |
| 235 |
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); |
| 236 |
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); |
| 237 |
COMMIT; |
| 238 |
SET AUTOCOMMIT=OFF; |
| 239 |
START TRANSACTION; |
| 240 |
INSERT INTO t1 VALUES (36,'node1_committed_after'); |
| 241 |
INSERT INTO t1 VALUES (37,'node1_committed_after'); |
| 242 |
INSERT INTO t1 VALUES (38,'node1_committed_after'); |
| 243 |
INSERT INTO t1 VALUES (39,'node1_committed_after'); |
| 244 |
INSERT INTO t1 VALUES (40,'node1_committed_after'); |
| 245 |
COMMIT; |
| 246 |
connection node_1a_galera_st_clean_slave; |
| 247 |
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); |
| 248 |
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); |
| 249 |
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); |
| 250 |
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); |
| 251 |
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); |
| 252 |
ROLLBACK; |
| 253 |
SET AUTOCOMMIT=ON; |
| 254 |
SET SESSION wsrep_sync_wait=15; |
| 255 |
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
| 256 |
EXPECT_35 |
| 257 |
35 |
| 258 |
SELECT * from t1; |
| 259 |
id f1 |
| 260 |
1 node1_committed_before |
| 261 |
2 node1_committed_before |
| 262 |
3 node1_committed_before |
| 263 |
4 node1_committed_before |
| 264 |
5 node1_committed_before |
| 265 |
6 node2_committed_before |
| 266 |
7 node2_committed_before |
| 267 |
8 node2_committed_before |
| 268 |
9 node2_committed_before |
| 269 |
10 node2_committed_before |
| 270 |
11 node1_committed_during |
| 271 |
12 node1_committed_during |
| 272 |
13 node1_committed_during |
| 273 |
14 node1_committed_during |
| 274 |
15 node1_committed_during |
| 275 |
16 node1_to_be_committed_after |
| 276 |
17 node1_to_be_committed_after |
| 277 |
18 node1_to_be_committed_after |
| 278 |
19 node1_to_be_committed_after |
| 279 |
20 node1_to_be_committed_after |
| 280 |
26 node2_committed_after |
| 281 |
27 node2_committed_after |
| 282 |
28 node2_committed_after |
| 283 |
29 node2_committed_after |
| 284 |
30 node2_committed_after |
| 285 |
31 node1_to_be_committed_after |
| 286 |
32 node1_to_be_committed_after |
| 287 |
33 node1_to_be_committed_after |
| 288 |
34 node1_to_be_committed_after |
| 289 |
35 node1_to_be_committed_after |
| 290 |
36 node1_committed_after |
| 291 |
37 node1_committed_after |
| 292 |
38 node1_committed_after |
| 293 |
39 node1_committed_after |
| 294 |
40 node1_committed_after |
| 295 |
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
| 296 |
COUNT(*) = 0 |
| 297 |
1 |
| 298 |
COMMIT; |
| 299 |
connection node_1; |
| 300 |
SET AUTOCOMMIT=ON; |
| 301 |
SET SESSION wsrep_sync_wait=15; |
| 302 |
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
| 303 |
EXPECT_35 |
| 304 |
35 |
| 305 |
SELECT * from t1; |
| 306 |
id f1 |
| 307 |
1 node1_committed_before |
| 308 |
2 node1_committed_before |
| 309 |
3 node1_committed_before |
| 310 |
4 node1_committed_before |
| 311 |
5 node1_committed_before |
| 312 |
6 node2_committed_before |
| 313 |
7 node2_committed_before |
| 314 |
8 node2_committed_before |
| 315 |
9 node2_committed_before |
| 316 |
10 node2_committed_before |
| 317 |
11 node1_committed_during |
| 318 |
12 node1_committed_during |
| 319 |
13 node1_committed_during |
| 320 |
14 node1_committed_during |
| 321 |
15 node1_committed_during |
| 322 |
16 node1_to_be_committed_after |
| 323 |
17 node1_to_be_committed_after |
| 324 |
18 node1_to_be_committed_after |
| 325 |
19 node1_to_be_committed_after |
| 326 |
20 node1_to_be_committed_after |
| 327 |
26 node2_committed_after |
| 328 |
27 node2_committed_after |
| 329 |
28 node2_committed_after |
| 330 |
29 node2_committed_after |
| 331 |
30 node2_committed_after |
| 332 |
31 node1_to_be_committed_after |
| 333 |
32 node1_to_be_committed_after |
| 334 |
33 node1_to_be_committed_after |
| 335 |
34 node1_to_be_committed_after |
| 336 |
35 node1_to_be_committed_after |
| 337 |
36 node1_committed_after |
| 338 |
37 node1_committed_after |
| 339 |
38 node1_committed_after |
| 340 |
39 node1_committed_after |
| 341 |
40 node1_committed_after |
| 342 |
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
| 343 |
COUNT(*) = 0 |
| 344 |
1 |
| 345 |
DROP TABLE t1; |
| 346 |
COMMIT; |
| 347 |
disconnect node_2; |
| 348 |
disconnect node_1; |