| 1 |
--source include/galera_cluster.inc |
| 2 |
--source include/have_innodb.inc |
| 3 |
--source include/force_restart.inc |
| 4 |
|
| 5 |
--let $galera_connection_name = node_3 |
| 6 |
--let $galera_server_number = 3 |
| 7 |
--source include/galera_connect.inc |
| 8 |
|
| 9 |
# Save original auto_increment_offset values. |
| 10 |
--let $node_1=node_1 |
| 11 |
--let $node_2=node_2 |
| 12 |
--let $node_3=node_3 |
| 13 |
--source ../galera/include/auto_increment_offset_save.inc |
| 14 |
|
| 15 |
# |
| 16 |
# 1. Create different inconsistencies on nodes 2 and 3 |
| 17 |
# |
| 18 |
--connection node_2 |
| 19 |
SET SESSION wsrep_on=OFF; |
| 20 |
DROP SCHEMA test; |
| 21 |
|
| 22 |
--connection node_3 |
| 23 |
SET SESSION wsrep_on=OFF; |
| 24 |
CREATE TABLE test.t1 (f1 INTEGER NOT NULL PRIMARY KEY) engine=innodb; |
| 25 |
# |
| 26 |
# 2. The following should generate different errors on nodes 2 and 3 and |
| 27 |
# trigger voting with 3 different votes. node_1 should remain alone |
| 28 |
# in the cluster. |
| 29 |
# |
| 30 |
--connection node_1 |
| 31 |
CREATE TABLE test.t1 (f1 INTEGER NOT NULL PRIMARY KEY) engine=innodb; |
| 32 |
INSERT INTO test.t1 values (1); |
| 33 |
|
| 34 |
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' |
| 35 |
--source include/wait_condition.inc |
| 36 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status' |
| 37 |
--source include/wait_condition.inc |
| 38 |
SHOW STATUS LIKE 'wsrep_cluster_status'; |
| 39 |
|
| 40 |
# Test cleanup |
| 41 |
DROP TABLE test.t1; |
| 42 |
# |
| 43 |
# 3. Wait for nodes 2 and 3 to drop out of the cluster and restart them to |
| 44 |
# recover the initial configuration. |
| 45 |
# |
| 46 |
--connection node_2 |
| 47 |
SET SESSION wsrep_sync_wait=0; |
| 48 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'OFF' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' |
| 49 |
--source include/wait_condition.inc |
| 50 |
SHOW STATUS LIKE 'wsrep_cluster_status'; |
| 51 |
|
| 52 |
# need to reinitialize connection due to a "Bad handshake" bug |
| 53 |
--disconnect node_2 |
| 54 |
--connect node_2, 127.0.0.1, root, , mysql, $NODE_MYPORT_2 |
| 55 |
|
| 56 |
--source include/kill_galera.inc |
| 57 |
|
| 58 |
--connection node_2 |
| 59 |
--source include/wait_until_disconnected.inc |
| 60 |
--echo Starting node_2 |
| 61 |
--source include/start_mysqld.inc |
| 62 |
|
| 63 |
--connection node_3 |
| 64 |
SET SESSION wsrep_sync_wait=0; |
| 65 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'OFF' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' |
| 66 |
--source include/wait_condition.inc |
| 67 |
SHOW STATUS LIKE 'wsrep_cluster_status'; |
| 68 |
|
| 69 |
# need to reinitialize connection due to a "Bad handshake" bug |
| 70 |
--disconnect node_3 |
| 71 |
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 |
| 72 |
|
| 73 |
--source include/kill_galera.inc |
| 74 |
|
| 75 |
--connection node_3 |
| 76 |
--source include/wait_until_disconnected.inc |
| 77 |
--echo Starting node_3 |
| 78 |
--source include/start_mysqld.inc |
| 79 |
|
| 80 |
--connection node_1 |
| 81 |
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' |
| 82 |
--source include/wait_condition.inc |
| 83 |
--echo Nodes 2 and 3 started |
| 84 |
|
| 85 |
--connection node_2 |
| 86 |
# fix the default schema |
| 87 |
USE test; |
| 88 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' |
| 89 |
--source include/wait_condition.inc |
| 90 |
--echo Node 2 synced |
| 91 |
CALL mtr.add_suppression("Slave SQL: Error 'Unknown database 'test'' on query\\. Default database: 'test'\\. Query: 'CREATE TABLE test\\.t1 \\(f1 INTEGER\\)', Error_code: 1049"); |
| 92 |
CALL mtr.add_suppression("Query apply failed"); |
| 93 |
CALL mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on "); |
| 94 |
CALL mtr.add_suppression("Plugin 'InnoDB' will be forced to shutdown"); |
| 95 |
CALL mtr.add_suppression("WSREP: Cert position .* less than last committed"); |
| 96 |
CALL mtr.add_suppression("WSREP: Sending JOIN failed: "); |
| 97 |
|
| 98 |
--connection node_3 |
| 99 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' |
| 100 |
--source include/wait_condition.inc |
| 101 |
--echo Node 3 synced |
| 102 |
CALL mtr.add_suppression("Slave SQL: Error 'Table 't1' already exists' on query\\. Default database: 'test'\\. Query: 'CREATE TABLE test\\.t1 \\(f1 INTEGER\\)', Error_code: 1050"); |
| 103 |
CALL mtr.add_suppression("Query apply failed"); |
| 104 |
CALL mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on "); |
| 105 |
CALL mtr.add_suppression("Plugin 'InnoDB' will be forced to shutdown"); |
| 106 |
CALL mtr.add_suppression("WSREP: Cert position .* less than last committed"); |
| 107 |
CALL mtr.add_suppression("WSREP: Sending JOIN failed: "); |
| 108 |
|
| 109 |
--source ../galera/include/auto_increment_offset_restore.inc |