diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-04-30 19:48:11 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-05-03 11:21:55 +0200 |
commit | f875c9f2a090f98ba9d9e881165b4cf71cd6a8a2 (patch) | |
tree | 6b773c01b2591f368898f293bdfd77d15653910e /sql/rpl_rli.cc | |
parent | e6d918cacba8c5f3b002c4eb0244f44c3c941818 (diff) | |
download | mariadb-git-f875c9f2a090f98ba9d9e881165b4cf71cd6a8a2.tar.gz |
MDEV-5114 seconds_behind_master flips to 0 & spikes back, when running show slaves status
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
Diffstat (limited to 'sql/rpl_rli.cc')
-rw-r--r-- | sql/rpl_rli.cc | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index a324c3c30da..9bd0ca55b01 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1290,13 +1290,9 @@ bool Relay_log_info::is_until_satisfied(THD *thd, Log_event *ev) } -void Relay_log_info::stmt_done(my_off_t event_master_log_pos, - time_t event_creation_time, THD *thd, +void Relay_log_info::stmt_done(my_off_t event_master_log_pos, THD *thd, rpl_group_info *rgi) { -#ifndef DBUG_OFF - extern uint debug_not_change_ts_if_art_event; -#endif DBUG_ENTER("Relay_log_info::stmt_done"); DBUG_ASSERT(rgi->rli == this); @@ -1350,22 +1346,6 @@ void Relay_log_info::stmt_done(my_off_t event_master_log_pos, if (mi->using_gtid == Master_info::USE_GTID_NO) flush_relay_log_info(this); DBUG_EXECUTE_IF("inject_crash_after_flush_rli", DBUG_SUICIDE();); - /* - Note that Rotate_log_event::do_apply_event() does not call this - function, so there is no chance that a fake rotate event resets - last_master_timestamp. Note that we update without mutex - (probably ok - except in some very rare cases, only consequence - is that value may take some time to display in - Seconds_Behind_Master - not critical). - - In parallel replication, we take care to not set last_master_timestamp - backwards, in case of out-of-order calls here. - */ - if (!(event_creation_time == 0 && - IF_DBUG(debug_not_change_ts_if_art_event > 0, 1)) && - !(rgi->is_parallel_exec && event_creation_time <= last_master_timestamp) - ) - last_master_timestamp= event_creation_time; } DBUG_VOID_RETURN; } |