| 1 |
# |
| 2 |
# MDEV-37494: Inconsistency voting: create conditions where applying would |
| 3 |
# fail on replicas in table_def::compatible_with() and check that |
| 4 |
# that replicas survive and the primary (trx source) bails out. |
| 5 |
# |
| 6 |
--source include/galera_cluster.inc |
| 7 |
--source include/have_perfschema.inc |
| 8 |
|
| 9 |
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 BLOB) ENGINE=InnoDB; |
| 10 |
|
| 11 |
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 |
| 12 |
--connection node_3 |
| 13 |
SET GLOBAL wsrep_on=OFF; |
| 14 |
ALTER TABLE t1 MODIFY f2 LONGTEXT; # Introducing schema inconsistency |
| 15 |
SET GLOBAL wsrep_on=ON; |
| 16 |
INSERT INTO t1 VALUES (3, 'a'); # Nodes 1 and 2 should fail to apply this |
| 17 |
|
| 18 |
--connection node_1 |
| 19 |
# Wait until node #3 leaves the cluster |
| 20 |
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_size' |
| 21 |
--source include/wait_condition.inc |
| 22 |
SHOW STATUS LIKE 'wsrep_cluster_status'; |
| 23 |
|
| 24 |
--connection node_2 |
| 25 |
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_size' |
| 26 |
# Wait until node #3 leaves the cluster |
| 27 |
--source include/wait_condition.inc |
| 28 |
SHOW STATUS LIKE 'wsrep_cluster_status'; |
| 29 |
|
| 30 |
INSERT INTO t1 VALUES (2, 'a'); # Nodes 1 and 2 should successfully apply this |
| 31 |
|
| 32 |
--connection node_3 |
| 33 |
SET SESSION wsrep_sync_wait=0; |
| 34 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'Disconnected' FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status'; |
| 35 |
--source include/wait_condition.inc |
| 36 |
SET SESSION wsrep_on=OFF; |
| 37 |
--source include/restart_mysqld.inc |
| 38 |
--source include/wait_wsrep_ready.inc |
| 39 |
SET SESSION wsrep_on=ON; |
| 40 |
|
| 41 |
INSERT INTO t1 VALUES (3, 'a'); # All nodes should successfully apply this |
| 42 |
|
| 43 |
# Check that consistency is restored |
| 44 |
--connection node_1 |
| 45 |
SHOW CREATE TABLE t1; |
| 46 |
SELECT * FROM t1; |
| 47 |
|
| 48 |
--connection node_2 |
| 49 |
SHOW CREATE TABLE t1; |
| 50 |
SELECT * FROM t1; |
| 51 |
|
| 52 |
--connection node_3 |
| 53 |
SHOW CREATE TABLE t1; |
| 54 |
SELECT * FROM t1; |
| 55 |
|
| 56 |
DROP TABLE t1; |
| 57 |
|
| 58 |
--connection node_1 |
| 59 |
CALL mtr.add_suppression("Replica SQL: Column 1 of table 'test.t1' cannot be converted from type 'longblob' to type 'blob', Error_code: MY-013146"); |
| 60 |
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 3, seqno"); |
| 61 |
|
| 62 |
--connection node_2 |
| 63 |
CALL mtr.add_suppression("Replica SQL: Column 1 of table 'test.t1' cannot be converted from type 'longblob' to type 'blob', Error_code: MY-013146"); |
| 64 |
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 3, seqno"); |
| 65 |
|
| 66 |
--connection node_3 |
| 67 |
CALL mtr.add_suppression("Vote 0 \\(success\\) on (.*) is inconsistent with group. Leaving cluster."); |
| 68 |
CALL mtr.add_suppression("Plugin 'InnoDB' will be forced to shutdown"); |