| 1 |
# |
| 2 |
# This test tests voting (successful slave wins) in the absence of the master |
| 3 |
# for trasaction. |
| 4 |
# |
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/have_innodb.inc |
| 7 |
|
| 8 |
--let $galera_connection_name = node_3 |
| 9 |
--let $galera_server_number = 3 |
| 10 |
--source include/galera_connect.inc |
| 11 |
|
| 12 |
# Save original auto_increment_offset values. |
| 13 |
--let $node_1=node_1 |
| 14 |
--let $node_2=node_2 |
| 15 |
--let $node_3=node_3 |
| 16 |
--source ../galera/include/auto_increment_offset_save.inc |
| 17 |
|
| 18 |
CREATE TABLE test.t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; |
| 19 |
|
| 20 |
--connection node_2 |
| 21 |
--let $wsrep_provider_orig = `SELECT @@wsrep_provider` |
| 22 |
--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` |
| 23 |
SET wsrep_on=OFF; |
| 24 |
INSERT INTO t1 VALUES (1); |
| 25 |
LOCK TABLE t1 WRITE; |
| 26 |
SET GLOBAL wsrep_sync_wait=0; |
| 27 |
|
| 28 |
--connection node_1 |
| 29 |
INSERT INTO t1 VALUES (1); |
| 30 |
SET GLOBAL wsrep_sync_wait=0; |
| 31 |
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1'; |
| 32 |
|
| 33 |
--connection node_3 |
| 34 |
# wait for node_1 to disappear |
| 35 |
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 36 |
--source include/wait_condition.inc |
| 37 |
|
| 38 |
--connection node_2 |
| 39 |
UNLOCK TABLES; |
| 40 |
# wait to go non-Primary due to inconsistency voting |
| 41 |
#--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; |
| 42 |
#--source include/wait_condition.inc |
| 43 |
# Somehow the above times out so we use connectin to node 3 |
| 44 |
|
| 45 |
--connection node_3 |
| 46 |
# wait for node_1 to disappear |
| 47 |
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 48 |
--source include/wait_condition.inc |
| 49 |
|
| 50 |
--connection node_1 |
| 51 |
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0'; |
| 52 |
--source include/galera_wait_ready.inc |
| 53 |
SET GLOBAL wsrep_sync_wait=15; |
| 54 |
DROP TABLE test.t1; |
| 55 |
|
| 56 |
# reconnect node 2, since it is now inconsistent |
| 57 |
--connection node_2 |
| 58 |
--source include/kill_galera.inc |
| 59 |
--source include/wait_until_disconnected.inc |
| 60 |
--source include/start_mysqld.inc |
| 61 |
|
| 62 |
--connection node_2 |
| 63 |
CALL mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on "); |
| 64 |
CALL mtr.add_suppression("Slave SQL: Could not execute Write_rows event on table test\\.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log FIRST"); |
| 65 |
CALL mtr.add_suppression("WSREP: Event 3 Write_rows_v1 apply failed: 121, seqno"); |
| 66 |
CALL mtr.add_suppression("WSREP: Node consistency compromized, leaving cluster\\.\\.\\."); |
| 67 |
CALL mtr.add_suppression("WSREP: Failed to apply write set: "); |
| 68 |
|
| 69 |
# Restore original auto_increment_offset values. |
| 70 |
--source ../galera/include/auto_increment_offset_restore.inc |