mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #50296 Slave reconnects earlier than the prescribed slave_net_timeout value
There was auto-reconnecting by slave earlier than a prescribed by slave_net_timeout value. The issue happened on 64bit solaris that spotted rather incorrect casting of the ulong slave_net_timeout into the uint of mysql.options.read_timeout. Notice, that there is no reason for slave_net_timeout to be of type of ulong. Since it's primarily passed as arg to mysql_options the type can be made as uint to avoid all conversion hassles. That's what the fixes are made. A "side" effect of the patch is a new value for the max of slave_net_timeout to be the max of the unsigned int type (therefore to vary across platforms). Note, a regression test can't be made to run reliably without making it to last over some 20 secs. That's why it is placed in suite/large_tests. mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result: the new test results. mysql-test/suite/large_tests/t/rpl_slave_net_timeout-slave.opt: Initialization of the option that yields slave_net_timeout's default. sql/mysql_priv.h: changing type for slave_net_timeout from ulong to uint sql/mysqld.cc: changing type for slave_net_timeout from ulong to uint sql/sys_vars.cc: Refining the max value for slave_net_timeout to be as the max for uint type.
This commit is contained in:
25
mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result
Normal file
25
mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result
Normal file
@ -0,0 +1,25 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
set @save_general_log = @@global.general_log;
|
||||
set @save_log_output = @@global.log_output;
|
||||
set @save_slave_net_timeout = @@global.slave_net_timeout;
|
||||
set @@global.general_log = ON;
|
||||
set @@global.log_output = 'table,file';
|
||||
include/stop_slave.inc
|
||||
set @@global.slave_net_timeout = @@global.net_read_timeout * 2;
|
||||
change master to master_host = '127.0.0.1',master_port = 13020,
|
||||
master_user = 'root', master_heartbeat_period = 0;
|
||||
include/start_slave.inc
|
||||
include/stop_slave.inc
|
||||
select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time desc limit 1 into @ts_last;
|
||||
select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time asc limit 1 into @ts_prev;
|
||||
select @result as 'Must be 1';
|
||||
Must be 1
|
||||
1
|
||||
set @@global.general_log = @save_general_log;
|
||||
set @@global.log_output = @save_log_output;
|
||||
set @@global.slave_net_timeout = @save_slave_net_timeout;
|
Reference in New Issue
Block a user