summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2015-10-22 10:28:51 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2015-11-13 10:24:53 +0100
commit75dc2671011ba53e4f4531752c213ced7f9012ff (patch)
tree1fda725bc4315c4190a9c39917791788788b05ef /sql/slave.cc
parente7cb032e560e14865941ecdcb553cd3aba856b68 (diff)
downloadmariadb-git-75dc2671011ba53e4f4531752c213ced7f9012ff.tar.gz
Change Seconds_behind_master to be updated only at commit in parallel replication
Before, the Seconds_behind_master was updated already when an event was queued for a worker thread to execute later. This might lead users to interpret a low value as the slave being almost up to date with the master, while in reality there might still be lots and lots of events still queued up waiting to be applied by the slave. See https://lists.launchpad.net/maria-developers/msg08958.html for more detailed discussions.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 5af48b6a793..32f384d4e22 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3500,8 +3500,13 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli,
If it is an artificial event, or a relay log event (IO thread generated
event) or ev->when is set to 0, we don't update the
last_master_timestamp.
+
+ In parallel replication, we might queue a large number of events, and
+ the user might be surprised to see a claim that the slave is up to date
+ long before those queued events are actually executed.
*/
- if (!(ev->is_artificial_event() || ev->is_relay_log_event() || (ev->when == 0)))
+ if (opt_slave_parallel_threads == 0 &&
+ !(ev->is_artificial_event() || ev->is_relay_log_event() || (ev->when == 0)))
{
rli->last_master_timestamp= ev->when + (time_t) ev->exec_time;
DBUG_ASSERT(rli->last_master_timestamp >= 0);