summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorBrandon Nesterenko <brandon.nesterenko@mariadb.com>2021-12-27 11:53:14 -0700
committerBrandon Nesterenko <brandon.nesterenko@mariadb.com>2022-01-04 11:21:33 -0700
commit96de6bfd5e0d08bd99a47e8a3d60b1c2900a38f8 (patch)
tree1bd04187d47ac69194d7a6024b8016b03c297337 /sql/slave.cc
parent452c9a4d72c18a19136a91f4d59ee60eedd486be (diff)
downloadmariadb-git-96de6bfd5e0d08bd99a47e8a3d60b1c2900a38f8.tar.gz
MDEV-16091: Seconds_Behind_Master spikes to millions of secondsbb-10.2-MDEV-16091
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 <andrei.elkin@mariadb.com>
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 761fdbe807a..2ff1a0490e9 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -4033,6 +4033,15 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli,
#endif /* WITH_WSREP */
thread_safe_increment64(&rli->executed_entries);
+ DBUG_EXECUTE_IF(
+ "pause_sql_thread_on_fde",
+ if (ev && typ == FORMAT_DESCRIPTION_EVENT) {
+ DBUG_ASSERT(!debug_sync_set_action(
+ thd,
+ STRING_WITH_LEN(
+ "now SIGNAL paused_on_fde WAIT_FOR sql_thread_continue")));
+ });
+
DBUG_RETURN(exec_res);
}
mysql_mutex_unlock(&rli->data_lock);