summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@mariadb.com>2018-11-07 15:24:30 +0200
committerAndrei Elkin <andrei.elkin@mariadb.com>2018-11-07 21:13:50 +0200
commitc565622c6c6f2cb5e1dbc034a934a91f9ff08fa4 (patch)
tree0264019cd9db6d6af943de1e7b7ef0e6700d047d /sql
parente82ebb8f06674a22d959b91415c084ed34fe994d (diff)
downloadmariadb-git-c565622c6c6f2cb5e1dbc034a934a91f9ff08fa4.tar.gz
MDEV-14528 followup.
There was a failure in rpl_delayed_slave after recent MDEV-14528 commit. The parallel applier should not set its Relay_log::last_master_timestamp from Format-descriptor log event. The latter may reflect a deep past so Seconds-behind-master will be computed through it and displayed all time while the first possibly "slow" group of events is executed. The main MDEV-14528 is refined, rpl_delayed_slave now passes also in the parallel mode.
Diffstat (limited to 'sql')
-rw-r--r--sql/slave.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index d6223453a5b..f3e08f14213 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3962,7 +3962,15 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli,
*/
if (!(ev->is_artificial_event() || ev->is_relay_log_event() || (ev->when == 0)))
{
- rli->last_master_timestamp= ev->when + (time_t) ev->exec_time;
+ /*
+ Ignore FD's timestamp as it does not reflect the slave execution
+ state but likely to reflect a deep past. Consequently when the first
+ data modification event execution last long all this time
+ Seconds_Behind_Master is zero.
+ */
+ if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
+ rli->last_master_timestamp= ev->when + (time_t) ev->exec_time;
+
DBUG_ASSERT(rli->last_master_timestamp >= 0);
}
}