summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.h
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2014-01-08 11:00:44 +0100
committerunknown <knielsen@knielsen-hq.org>2014-01-08 11:00:44 +0100
commit8cc6e90d74f4377491bcb7a0f1acd41ccf9fbcae (patch)
tree9d9878767d72068230ba15fc934259524b81c34d /sql/rpl_parallel.h
parentbfdbb17990b198ff2a7e5eda5e2a365a1c6d8906 (diff)
downloadmariadb-git-8cc6e90d74f4377491bcb7a0f1acd41ccf9fbcae.tar.gz
MDEV-5509: Seconds_behind_master incorrect in parallel replication
The problem was a race between the SQL driver thread and the worker threads. The SQL driver thread would set rli->last_master_timestamp to zero to mark that it has caught up with the master, while the worker threads would set it to the timestamp of the executed event. This can happen out-of-order in parallel replication, causing the "caught up" status to be overwritten and Seconds_Behind_Master to wrongly grow when the slave is idle. To fix, introduce a separate flag rli->sql_thread_caught_up to mark that the SQL driver thread is caught up. This avoids issues with worker threads overwriting the SQL driver thread status. In parallel replication, we then make SHOW SLAVE STATUS check in addition that all worker threads are idle before showing Seconds_Behind_Master as 0 due to slave idle.
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r--sql/rpl_parallel.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index 0e88e09652b..019a354c57d 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -117,6 +117,7 @@ struct rpl_parallel {
void reset();
rpl_parallel_entry *find(uint32 domain_id);
void wait_for_done();
+ bool workers_idle();
bool do_event(rpl_group_info *serial_rgi, Log_event *ev,
ulonglong event_size);
};