summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-04-30 19:48:11 +0200
committerSergei Golubchik <serg@mariadb.org>2015-05-03 11:21:55 +0200
commitf875c9f2a090f98ba9d9e881165b4cf71cd6a8a2 (patch)
tree6b773c01b2591f368898f293bdfd77d15653910e /sql/log_event.cc
parente6d918cacba8c5f3b002c4eb0244f44c3c941818 (diff)
downloadmariadb-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/log_event.cc')
-rw-r--r--sql/log_event.cc27
1 files changed, 3 insertions, 24 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index b8fd02e96d4..5c5f5cdb9f1 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -337,10 +337,6 @@ private:
flag_set m_flags;
};
-#ifndef DBUG_OFF
-uint debug_not_change_ts_if_art_event= 1; // bug#29309 simulation
-#endif
-
/*
pretty_print_str()
*/
@@ -879,7 +875,7 @@ Log_event::Log_event()
Log_event::Log_event(const char* buf,
const Format_description_log_event* description_event)
- :temp_buf(0), cache_type(Log_event::EVENT_INVALID_CACHE),
+ :temp_buf(0), exec_time(0), cache_type(Log_event::EVENT_INVALID_CACHE),
crc(0), checksum_alg(BINLOG_CHECKSUM_ALG_UNDEF)
{
#ifndef MYSQL_CLIENT
@@ -970,29 +966,12 @@ int Log_event::do_update_pos(rpl_group_info *rgi)
if (rli)
{
/*
- bug#29309 simulation: resetting the flag to force
- wrong behaviour of artificial event to update
- rli->last_master_timestamp for only one time -
- the first FLUSH LOGS in the test.
- */
- DBUG_EXECUTE_IF("let_first_flush_log_change_timestamp",
- if (debug_not_change_ts_if_art_event == 1
- && is_artificial_event())
- debug_not_change_ts_if_art_event= 0; );
- /*
In parallel execution, delay position update for the events that are
not part of event groups (format description, rotate, and such) until
the actual event execution reaches that point.
*/
if (!rgi->is_parallel_exec || is_group_event(get_type_code()))
- rli->stmt_done(log_pos,
- (is_artificial_event() &&
- IF_DBUG(debug_not_change_ts_if_art_event > 0, 1) ?
- 0 : when),
- thd, rgi);
- DBUG_EXECUTE_IF("let_first_flush_log_change_timestamp",
- if (debug_not_change_ts_if_art_event == 0)
- debug_not_change_ts_if_art_event= 2; );
+ rli->stmt_done(log_pos, thd, rgi);
}
DBUG_RETURN(0); // Cannot fail currently
}
@@ -10107,7 +10086,7 @@ Rows_log_event::do_update_pos(rpl_group_info *rgi)
Step the group log position if we are not in a transaction,
otherwise increase the event log position.
*/
- rli->stmt_done(log_pos, when, thd, rgi);
+ rli->stmt_done(log_pos, thd, rgi);
/*
Clear any errors in thd->net.last_err*. It is not known if this is
needed or not. It is believed that any errors that may exist in