| 1 |
# |
| 2 |
# Shut down master (node #2) while an SR transaction is in progress |
| 3 |
# |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
|
| 7 |
# Save original auto_increment_offset values. |
| 8 |
--let $node_1=node_1 |
| 9 |
--let $node_2=node_2 |
| 10 |
--source ../galera/include/auto_increment_offset_save.inc |
| 11 |
|
| 12 |
--connection node_2 |
| 13 |
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE = InnoDB; |
| 14 |
|
| 15 |
SET AUTOCOMMIT=OFF; |
| 16 |
SET SESSION wsrep_trx_fragment_size=1; |
| 17 |
START TRANSACTION; |
| 18 |
|
| 19 |
INSERT INTO t1 VALUES (1),(2),(3); |
| 20 |
|
| 21 |
--connection node_1 |
| 22 |
--let $wait_condition = SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; |
| 23 |
--source include/wait_condition.inc |
| 24 |
|
| 25 |
--connection node_2 |
| 26 |
--source include/shutdown_mysqld.inc |
| 27 |
|
| 28 |
--connection node_1 |
| 29 |
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 30 |
|
| 31 |
# Confirm that SR table on slave is empty |
| 32 |
SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; |
| 33 |
SELECT COUNT(*) = 0 FROM t1; |
| 34 |
|
| 35 |
--connection node_2 |
| 36 |
--source include/start_mysqld.inc |
| 37 |
|
| 38 |
# SR table on master should be empty too |
| 39 |
SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; |
| 40 |
|
| 41 |
# Confirm that the INSERT can be re-issued |
| 42 |
INSERT INTO t1 VALUES (1),(2),(3); |
| 43 |
|
| 44 |
--connection node_1 |
| 45 |
SELECT COUNT(*) = 3 FROM t1; |
| 46 |
|
| 47 |
DROP TABLE t1; |
| 48 |
|
| 49 |
--connection node_2 |
| 50 |
CALL mtr.add_suppression("WSREP: Failed to replicate rollback fragment for "); |
| 51 |
|
| 52 |
# Restore original auto_increment_offset values. |
| 53 |
--source ../galera/include/auto_increment_offset_restore.inc |