mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
BUG#11877618: rpl_slave_net_timeout fails in rpl_sync.inc (at sync_slave_with_master)
Problem: the test had not been updated after BUG#49978 was pushed Fix: add 'set $rpl_only_running_threads= 1' to the end of the test and update the result file. Also, use include/assert.inc for an assertion (instead of relying on result file comparison). Also, move 'set @@global.slave_net_timeout' forwards, to get rid of a warning.
This commit is contained in:
parent
37f49e697e
commit
c0613a9fd7
2 changed files with 12 additions and 20 deletions
|
@ -1,25 +1,20 @@
|
|||
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;
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
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 = MASTER_PORT,
|
||||
master_user = 'root', master_heartbeat_period = 0;
|
||||
set @@global.slave_net_timeout = @@global.net_read_timeout * 2;
|
||||
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
|
||||
include/assert.inc [time between last reconnection and the reconnection before that should be >= slave_net_timeout]
|
||||
set @@global.general_log = @save_general_log;
|
||||
set @@global.log_output = @save_log_output;
|
||||
set @@global.slave_net_timeout = @save_slave_net_timeout;
|
||||
include/rpl_end.inc
|
||||
|
|
|
@ -21,11 +21,6 @@ set @@global.log_output = 'table,file';
|
|||
|
||||
connection slave;
|
||||
--source include/stop_slave.inc
|
||||
--disable_warnings
|
||||
set @@global.slave_net_timeout = @@global.net_read_timeout * 2;
|
||||
--enable_warnings
|
||||
let $idle_time=`select @@global.slave_net_timeout * 2`;
|
||||
|
||||
#
|
||||
# if heartbeat is disabled then reconnecting to the idle master
|
||||
# should happen with `slave_net_timeout' period.
|
||||
|
@ -42,6 +37,9 @@ let $idle_time=`select @@global.slave_net_timeout * 2`;
|
|||
eval change master to master_host = '127.0.0.1',master_port = $MASTER_MYPORT,
|
||||
master_user = 'root', master_heartbeat_period = 0;
|
||||
|
||||
set @@global.slave_net_timeout = @@global.net_read_timeout * 2;
|
||||
let $idle_time=`select @@global.slave_net_timeout * 2`;
|
||||
|
||||
let $slave_net_timeout = `select @@global.slave_net_timeout`;
|
||||
|
||||
--source include/start_slave.inc
|
||||
|
@ -64,11 +62,9 @@ connection master;
|
|||
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;
|
||||
|
||||
--disable_query_log
|
||||
eval select time_to_sec(@ts_last) - $slave_net_timeout >= time_to_sec(@ts_prev) into @result;
|
||||
--enable_query_log
|
||||
|
||||
select @result as 'Must be 1';
|
||||
--let $assert_cond= time_to_sec(@ts_last) - time_to_sec(@ts_prev) >= $slave_net_timeout
|
||||
--let $assert_text= time between last reconnection and the reconnection before that should be >= slave_net_timeout
|
||||
--source include/assert.inc
|
||||
|
||||
# cleanup
|
||||
|
||||
|
@ -79,4 +75,5 @@ set @@global.log_output = @save_log_output;
|
|||
connection slave;
|
||||
set @@global.slave_net_timeout = @save_slave_net_timeout;
|
||||
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_end.inc
|
||||
|
|
Loading…
Add table
Reference in a new issue