| 1 |
# |
| 2 |
# This test kills the slave while a Streaming Replication transaction is in progress |
| 3 |
# and after a fragment has already been applied on the slave. It is expected that |
| 4 |
# after the slave restarts, the cluster will continue to be consistent |
| 5 |
# |
| 6 |
|
| 7 |
--source include/galera_cluster.inc |
| 8 |
--source include/have_innodb.inc |
| 9 |
|
| 10 |
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 |
| 11 |
# Save original auto_increment_offset values. |
| 12 |
--let $node_1=node_1 |
| 13 |
--let $node_2=node_2 |
| 14 |
--let $node_3=node_3 |
| 15 |
--source ../galera/include/auto_increment_offset_save.inc |
| 16 |
|
| 17 |
--connection node_1 |
| 18 |
|
| 19 |
--let $wsrep_trx_fragment_size_orig = `SELECT @@wsrep_trx_fragment_size` |
| 20 |
SET SESSION wsrep_trx_fragment_size = 1; |
| 21 |
SET AUTOCOMMIT=OFF; |
| 22 |
START TRANSACTION; |
| 23 |
|
| 24 |
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; |
| 25 |
INSERT INTO t1 VALUES (1); |
| 26 |
INSERT INTO t1 VALUES (2); |
| 27 |
INSERT INTO t1 VALUES (3); |
| 28 |
INSERT INTO t1 VALUES (4); |
| 29 |
INSERT INTO t1 VALUES (5); |
| 30 |
|
| 31 |
--connection node_2 |
| 32 |
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; |
| 33 |
--let $wait_condition = SELECT COUNT(*) > 0 FROM t1; |
| 34 |
--source include/wait_condition.inc |
| 35 |
|
| 36 |
--source include/kill_galera.inc |
| 37 |
|
| 38 |
--connection node_1 |
| 39 |
INSERT INTO t1 VALUES (6); |
| 40 |
INSERT INTO t1 VALUES (7); |
| 41 |
INSERT INTO t1 VALUES (8); |
| 42 |
INSERT INTO t1 VALUES (9); |
| 43 |
INSERT INTO t1 VALUES (10); |
| 44 |
|
| 45 |
--connection node_2 |
| 46 |
--source include/start_mysqld.inc |
| 47 |
|
| 48 |
--source include/wait_until_connected_again.inc |
| 49 |
--source include/galera_wait_ready.inc |
| 50 |
|
| 51 |
--connection node_1 |
| 52 |
INSERT INTO t1 VALUES (11); |
| 53 |
INSERT INTO t1 VALUES (12); |
| 54 |
INSERT INTO t1 VALUES (13); |
| 55 |
INSERT INTO t1 VALUES (14); |
| 56 |
INSERT INTO t1 VALUES (15); |
| 57 |
|
| 58 |
--connection node_2 |
| 59 |
|
| 60 |
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; |
| 61 |
--let $wait_condition = SELECT COUNT(*) = 15 FROM t1; |
| 62 |
--source include/wait_condition.inc |
| 63 |
|
| 64 |
SELECT COUNT(*) = 15 FROM mysql.wsrep_streaming_log; |
| 65 |
|
| 66 |
--connection node_1 |
| 67 |
COMMIT; |
| 68 |
|
| 69 |
SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; |
| 70 |
|
| 71 |
--connection node_2 |
| 72 |
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; |
| 73 |
SELECT COUNT(*) = 15 FROM t1; |
| 74 |
SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; |
| 75 |
|
| 76 |
DROP TABLE t1; |
| 77 |
|
| 78 |
--connection node_3 |
| 79 |
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member"); |
| 80 |
|
| 81 |
--source ../galera/include/auto_increment_offset_restore.inc |