Commit 72fe4dec authored by Sven Sandberg's avatar Sven Sandberg

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.


mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result:
  updated result file
mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test:
   - Got rid of warning "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." by
     changing order of "set slave_net_timeout" and
     "change master to master_heartbeat_period".
   - replaced result file comparison by include/assert.inc
   - added "let $rpl_only_running_threads= 1"
parent 99a8398f
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment