| 1 |
--source include/galera_cluster.inc |
| 2 |
--source include/have_innodb.inc |
| 3 |
|
| 4 |
# |
| 5 |
# Test that a SR transaction that was just ROLLBACKed on one node can be |
| 6 |
# run against another node without any conflicts |
| 7 |
# |
| 8 |
|
| 9 |
--connection node_1 |
| 10 |
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; |
| 11 |
--let $wsrep_trx_fragment_size_orig = `SELECT @@wsrep_trx_fragment_size` |
| 12 |
SET SESSION wsrep_trx_fragment_size = 1; |
| 13 |
SET AUTOCOMMIT=OFF; |
| 14 |
START TRANSACTION; |
| 15 |
INSERT INTO t1 VALUES (1); |
| 16 |
INSERT INTO t1 VALUES (2); |
| 17 |
INSERT INTO t1 VALUES (3); |
| 18 |
INSERT INTO t1 VALUES (4); |
| 19 |
INSERT INTO t1 VALUES (5); |
| 20 |
|
| 21 |
--connection node_2 |
| 22 |
--let $wait_condition = SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log |
| 23 |
--source include/wait_condition.inc |
| 24 |
|
| 25 |
--connection node_1 |
| 26 |
ROLLBACK; |
| 27 |
|
| 28 |
# |
| 29 |
# After ROLLBACK, the table on node #2 should be empty |
| 30 |
# |
| 31 |
|
| 32 |
--connection node_2 |
| 33 |
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1; |
| 34 |
--source include/wait_condition.inc |
| 35 |
SELECT * FROM t1; |
| 36 |
|
| 37 |
# |
| 38 |
# It should be possible to reissue the same transaction against node #2 |
| 39 |
# |
| 40 |
|
| 41 |
SET AUTOCOMMIT=OFF; |
| 42 |
START TRANSACTION; |
| 43 |
INSERT INTO t1 VALUES (1); |
| 44 |
INSERT INTO t1 VALUES (2); |
| 45 |
INSERT INTO t1 VALUES (3); |
| 46 |
INSERT INTO t1 VALUES (4); |
| 47 |
INSERT INTO t1 VALUES (5); |
| 48 |
COMMIT; |
| 49 |
|
| 50 |
SELECT COUNT(*) AS EXPECT_5 FROM t1; |
| 51 |
|
| 52 |
--connection node_1 |
| 53 |
--let $wait_condition = SELECT COUNT(*) = 5 FROM t1; |
| 54 |
--source include/wait_condition.inc |
| 55 |
SELECT COUNT(*) AS EXPECT_5 FROM t1; |
| 56 |
|
| 57 |
DROP TABLE t1; |