| 1 |
# Testing master to slave heartbeat protocol, test cases that need debug build. |
| 2 |
|
| 3 |
--source include/have_debug.inc |
| 4 |
--source include/master-slave.inc |
| 5 |
|
| 6 |
--disable_query_log |
| 7 |
CALL mtr.add_suppression('SET @master_heartbeat_period to master failed with error'); |
| 8 |
CALL mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again'); |
| 9 |
call mtr.add_suppression("Could not read packet:.* errno: 11"); |
| 10 |
--enable_query_log |
| 11 |
|
| 12 |
connection slave; |
| 13 |
--source include/stop_slave.inc |
| 14 |
set @restore_slave_net_timeout= @@global.slave_net_timeout; |
| 15 |
--disable_warnings |
| 16 |
set @@global.slave_net_timeout= 10; |
| 17 |
--enable_warnings |
| 18 |
|
| 19 |
### |
| 20 |
### Checking the range |
| 21 |
### |
| 22 |
|
| 23 |
|
| 24 |
# default period slave_net_timeout/2 |
| 25 |
# |
| 26 |
--query_vertical show status like 'Slave_heartbeat_period'; |
| 27 |
SET @saved_dbug= @@GLOBAL.debug_dbug; |
| 28 |
SET GLOBAL debug_dbug="+d,simulate_slave_heartbeat_network_error"; |
| 29 |
|
| 30 |
--source include/start_slave.inc |
| 31 |
|
| 32 |
|
| 33 |
connection master; |
| 34 |
--disable_warnings |
| 35 |
drop table if exists t1; |
| 36 |
--enable_warnings |
| 37 |
|
| 38 |
CREATE TABLE t1 (a INT PRIMARY KEY); |
| 39 |
INSERT INTO t1 VALUES (1); |
| 40 |
|
| 41 |
sync_slave_with_master; |
| 42 |
|
| 43 |
--connection slave |
| 44 |
SELECT * FROM t1; |
| 45 |
|
| 46 |
connection master; |
| 47 |
drop table t1; |
| 48 |
|
| 49 |
connection slave; |
| 50 |
--source include/stop_slave.inc |
| 51 |
--disable_warnings |
| 52 |
SET GLOBAL debug_dbug=@saved_dbug; |
| 53 |
set @@global.slave_net_timeout= @restore_slave_net_timeout; |
| 54 |
--enable_warnings |
| 55 |
--source include/start_slave.inc |
| 56 |
|
| 57 |
--source include/rpl_end.inc |