From ddd79e29059dbb065c9f817382e4a0378171ba1d Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Wed, 5 Jan 2022 08:35:05 -0700 Subject: MDEV-16091: Seconds_Behind_Master spikes to millions of seconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: ======== A slave’s relay log format description event is used when calculating Seconds_Behind_Master (SBM). This forces the SBM value to spike when processing these events, as their creation date is set to the timestamp that the IO thread begins. Solution: ======== When the slave generates a format description event, mark the event as a relay log event so it does not update the rli->last_master_timestamp variable. Reviewed By: ============ Andrei Elkin --- sql/log.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/log.cc') diff --git a/sql/log.cc b/sql/log.cc index c5a192d56d3..0f35d009a78 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3571,6 +3571,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name, opt_slave_sql_verify_checksum ? (enum_binlog_checksum_alg) binlog_checksum_options : BINLOG_CHECKSUM_ALG_OFF; s.checksum_alg= relay_log_checksum_alg; + s.set_relay_log_event(); } else s.checksum_alg= (enum_binlog_checksum_alg)binlog_checksum_options; -- cgit v1.2.1