1include/master-slave.inc
2[connection master]
3set @restore_slave_net_timeout= @@global.slave_net_timeout;
4set @@global.slave_net_timeout= 10;
5SHOW STATUS LIKE "Slave_last_heartbeat";
6Variable_name	Slave_last_heartbeat
7Value
8change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
9Warnings:
10Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
11Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
12show status like 'Slave_heartbeat_period';;
13Variable_name	Slave_heartbeat_period
14Value	5.000
15change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294968;
16ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
17show status like 'Slave_heartbeat_period';;
18Variable_name	Slave_heartbeat_period
19Value	5.000
20change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.0009999;
21Warnings:
22Warning	####	The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.
23Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
24Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
25show status like 'Slave_heartbeat_period';;
26Variable_name	Slave_heartbeat_period
27Value	0.000
28change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294967;
29Warnings:
30Warning	####	The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
31Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
32Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
33show status like 'Slave_heartbeat_period';;
34Variable_name	Slave_heartbeat_period
35Value	4294967.000
36change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.001;
37Warnings:
38Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
39Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
40show status like 'Slave_heartbeat_period';;
41Variable_name	Slave_heartbeat_period
42Value	0.001
43reset slave;
44set @@global.slave_net_timeout= 5;
45change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 5.001;
46Warnings:
47Warning	####	The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
48Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
49Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
50show status like 'Slave_heartbeat_period';;
51Variable_name	Slave_heartbeat_period
52Value	5.001
53reset slave;
54set @@global.slave_net_timeout= 5;
55Warnings:
56Warning	1704	The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
57change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4;
58Warnings:
59Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
60Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
61show status like 'Slave_heartbeat_period';;
62Variable_name	Slave_heartbeat_period
63Value	4.000
64set @@global.slave_net_timeout= 3 /* must be a warning */;
65Warnings:
66Warning	1704	The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
67reset slave;
68drop table if exists t1;
69set @@global.slave_net_timeout= 10;
70change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.5;
71Warnings:
72Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
73Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
74show status like 'Slave_heartbeat_period';;
75Variable_name	Slave_heartbeat_period
76Value	0.500
77start slave;
78create table t1 (f1 int);
79include/sync_slave_sql_with_master.inc
80include/check_slave_param.inc [Relay_Log_File]
81show status like 'Slave_heartbeat_period';;
82Variable_name	Slave_heartbeat_period
83Value	0.500
84A heartbeat has been received by the slave
85include/assert.inc [Slave_last_heartbeat should not be empty]
86drop table t1;
87include/sync_slave_sql_with_master.inc
88set @@global.slave_net_timeout= @restore_slave_net_timeout;
89include/stop_slave.inc
90CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD= 10;
91include/assert.inc [Slave_heartbeat_period should be 10.000]
92
93# Verify that heartbeat period is not reset to default implicitly and
94# received_heartbeat is not set to 0 by this.
95
96CHANGE MASTER TO MASTER_RETRY_COUNT= 3;
97include/assert.inc [Slave_heartbeat_period should be 10.000]
98include/assert.inc [Slave_received_heartbeat should NOT be set to 0]
99include/stop_slave.inc
100Warnings:
101Note	3084	Replication thread(s) for channel '' are already stopped.
102RESET SLAVE;
103include/start_slave.inc
104include/assert.inc [heartbeat period should still be 10.000 after RESET SLAVE.]
105include/stop_slave_io.inc
106CHANGE MASTER TO MASTER_HOST= 'localhost', MASTER_PORT= MASTER_PORT;
107include/start_slave.inc
108include/assert.inc [heartbeat period should reset to default.]
109#
110# Change from default to make sure changing HOST resets heartbeat_period
111# to default.
112#
113include/stop_slave_io.inc
114CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 10;
115include/start_slave.inc
116include/stop_slave.inc
117CHANGE MASTER TO MASTER_HOST= '127.0.0.1';
118include/start_slave.inc
119include/assert.inc [heartbeat period should reset to default on changing host.]
120#
121# Change from default to make sure changing PORT resets heartbeat_period
122# to default.
123#
124include/stop_slave.inc
125CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 10;
126include/start_slave.inc
127include/stop_slave.inc
128CHANGE MASTER TO MASTER_PORT= MASTER_PORT;
129include/start_slave.inc
130include/assert.inc [heartbeat period should reset to default on changing port.]
131#
132# Change from default to make sure changing HOST and PORT resets
133# heartbeat_period to default.
134#
135include/stop_slave.inc
136CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= MASTER_PORT;
137include/start_slave.inc
138include/assert.inc [heartbeat period should reset to default on changing host and port.]
139include/stop_slave.inc
140RESET SLAVE ALL;
141include/assert.inc [heartbeat period should reset to zero by RESET SLAVE ALL.]
142change master to master_host= '127.0.0.1', master_port= MASTER_PORT, master_user= 'root';
143Warnings:
144Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
145Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
146include/start_slave.inc
147DROP TABLE IF EXISTS t1;
148include/sync_slave_sql_with_master.inc
149include/rpl_end.inc
150