| 1 |
# |
| 2 |
# MW-284 Slave I/O retry on ER_COM_UNKNOWN_ERROR |
| 3 |
# |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/have_innodb.inc |
| 7 |
--source include/have_log_bin.inc |
| 8 |
|
| 9 |
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 |
| 10 |
call mtr.add_suppression("\\[ERROR\\] Error reading packet from server: WSREP has not yet prepared node for application use "); |
| 11 |
call mtr.add_suppression("WSREP has not yet prepared node for application use"); |
| 12 |
|
| 13 |
--disable_query_log |
| 14 |
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_1, master_connect_retry=1; |
| 15 |
--enable_query_log |
| 16 |
|
| 17 |
--connection node_1 |
| 18 |
--let $wsrep_sync_wait_state= `SELECT @@global.wsrep_sync_wait;` |
| 19 |
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; |
| 20 |
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; |
| 21 |
SET SESSION wsrep_on = OFF; |
| 22 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status' |
| 23 |
--source include/wait_condition.inc |
| 24 |
SET SESSION wsrep_on = ON; |
| 25 |
|
| 26 |
#wsrep_sync_wait is set to zero because when slave tries to connect it it ask for queries like SELECT UNIX_TIMESTAMP() on node 1 which will fail, causing |
| 27 |
#a warning in slave error log. |
| 28 |
SET global wsrep_sync_wait=0; |
| 29 |
|
| 30 |
--connection node_3 |
| 31 |
SELECT @@wsrep_on; |
| 32 |
--sleep 1 |
| 33 |
call mtr.add_suppression("Error reading packet from server: WSREP has not yet prepared node for application use \\(server_errno ?= ?1047\\)"); |
| 34 |
START SLAVE; |
| 35 |
--let $slave_param= Slave_IO_Running |
| 36 |
--let $slave_param_value= Connecting |
| 37 |
--source include/wait_for_slave_param.inc |
| 38 |
|
| 39 |
--connection node_1 |
| 40 |
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; |
| 41 |
|
| 42 |
# We expect the slave to reconnect and resume replication |
| 43 |
|
| 44 |
--connection node_3 |
| 45 |
--source include/wait_for_slave_to_start.inc |
| 46 |
|
| 47 |
--connection node_1 |
| 48 |
--source include/galera_wait_ready.inc |
| 49 |
INSERT INTO t1 VALUES (1); |
| 50 |
|
| 51 |
--connection node_3 |
| 52 |
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' |
| 53 |
--source include/wait_condition.inc |
| 54 |
--let $wait_condition = SELECT COUNT(*) > 0 FROM t1 |
| 55 |
--source include/wait_condition.inc |
| 56 |
|
| 57 |
# Cleanup |
| 58 |
|
| 59 |
--connection node_1 |
| 60 |
DROP TABLE t1; |
| 61 |
--eval SET global wsrep_sync_wait=$wsrep_sync_wait_state |
| 62 |
|
| 63 |
--connection node_3 |
| 64 |
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' |
| 65 |
--source include/wait_condition.inc |
| 66 |
|
| 67 |
STOP SLAVE; |
| 68 |
RESET SLAVE ALL; |
| 69 |
|
| 70 |
CALL mtr.add_suppression('failed registering on master'); |