| 1 |
--source include/galera_cluster.inc |
| 2 |
--source include/have_innodb.inc |
| 3 |
|
| 4 |
# |
| 5 |
# Test the case where the cluster splits 3 ways. |
| 6 |
# The master transitions to a non-prim view and back to prim. Its ongoing |
| 7 |
# should fail to commit. |
| 8 |
# |
| 9 |
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 |
| 10 |
|
| 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 |
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 |
| 18 |
|
| 19 |
--connection node_1 |
| 20 |
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; |
| 21 |
|
| 22 |
--connection node_2 |
| 23 |
SET SESSION wsrep_trx_fragment_size = 1; |
| 24 |
SET AUTOCOMMIT=OFF; |
| 25 |
START TRANSACTION; |
| 26 |
INSERT INTO t1 VALUES (20); |
| 27 |
INSERT INTO t1 VALUES (21); |
| 28 |
INSERT INTO t1 VALUES (22); |
| 29 |
INSERT INTO t1 VALUES (23); |
| 30 |
INSERT INTO t1 VALUES (24); |
| 31 |
|
| 32 |
--connection node_1 |
| 33 |
--let $wait_condition = SELECT COUNT(DISTINCT node_uuid) = 1 FROM mysql.wsrep_streaming_log |
| 34 |
--source include/wait_condition.inc |
| 35 |
|
| 36 |
# |
| 37 |
# Isolate node_2 into a separate non-primary component |
| 38 |
# |
| 39 |
|
| 40 |
--connection node_2a |
| 41 |
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; |
| 42 |
--disable_query_log |
| 43 |
SET WSREP_ON=OFF; |
| 44 |
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' |
| 45 |
--source include/wait_condition.inc |
| 46 |
SET WSREP_ON=ON; |
| 47 |
--enable_query_log |
| 48 |
|
| 49 |
--connection node_1 |
| 50 |
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' |
| 51 |
--source include/wait_condition.inc |
| 52 |
|
| 53 |
# |
| 54 |
# Confirm that node_1 has no transactions in SR table |
| 55 |
# |
| 56 |
|
| 57 |
--let $wait_condition = SELECT COUNT(DISTINCT node_uuid) = 0 FROM mysql.wsrep_streaming_log; |
| 58 |
--source include/wait_condition.inc |
| 59 |
|
| 60 |
# |
| 61 |
# Restore cluster |
| 62 |
# |
| 63 |
|
| 64 |
--connection node_2a |
| 65 |
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; |
| 66 |
--source include/galera_wait_ready.inc |
| 67 |
|
| 68 |
--connection node_1 |
| 69 |
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' |
| 70 |
--source include/wait_condition.inc |
| 71 |
|
| 72 |
--connection node_1 |
| 73 |
SELECT COUNT(DISTINCT node_uuid) = 1 FROM mysql.wsrep_streaming_log; |
| 74 |
|
| 75 |
--connection node_2 |
| 76 |
--error ER_LOCK_DEADLOCK |
| 77 |
COMMIT; |
| 78 |
SELECT * FROM t1; |
| 79 |
COMMIT; |
| 80 |
|
| 81 |
--connection node_1 |
| 82 |
SELECT * FROM t1; |
| 83 |
|
| 84 |
DROP TABLE t1; |
| 85 |
|
| 86 |
--connection node_2 |
| 87 |
CALL mtr.add_suppression("WSREP: failed to send SR rollback for "); |
| 88 |
|
| 89 |
--source ../galera/include/auto_increment_offset_restore.inc |