mirror of
https://github.com/MariaDB/server.git
synced 2025-01-26 08:44:33 +01:00
f875c9f2a0
1. After a period of wait (where last_master_timestamp=0) do NOT restore the last_master_timestamp to the timestamp of the last executed event (which would mean we've just executed it, and we're that much behind the master). 2. Update last_master_timestamp before executing the event, not after. Take the approach from the this commit (but with a different test case that actually makes sense): commit 0c75ab453fb8c5439576af8fe5add7a1b89f1569 Author: Luis Soares <luis.soares@sun.com> Date: Thu Apr 15 17:39:31 2010 +0100 BUG#52166: Seconds_Behind_Master spikes after long idle period
27 lines
598 B
Text
27 lines
598 B
Text
source include/master-slave.inc;
|
|
source include/have_binlog_format_statement.inc;
|
|
|
|
call mtr.add_suppression("Unsafe statement written to the binary log");
|
|
|
|
CREATE TABLE t1 (a int);
|
|
send INSERT INTO t1 VALUES(SLEEP(2));
|
|
|
|
connection slave;
|
|
let $run = 10;
|
|
while ($run)
|
|
{
|
|
dec $run;
|
|
let $sbm=query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1);
|
|
# for debugging uncomment echo and remove the if()
|
|
#echo Seconds_Behind_Master: $sbm;
|
|
if ($sbm)
|
|
{
|
|
let $run = 0;
|
|
}
|
|
sleep 0.5;
|
|
}
|
|
echo Seconds_Behind_Master: $sbm;
|
|
connection master;
|
|
reap;
|
|
drop table t1;
|
|
source include/rpl_end.inc;
|