summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2014-08-15 11:31:13 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2014-08-15 11:31:13 +0200
commitcfa1ce81bb7992c362958bb95f41325ce2109834 (patch)
tree1e80daded3dc2dc6df1c37f93b03f4ffd7a58807 /sql/rpl_parallel.h
parent65ac881c8096cd069e622da6cd699ff1d4aaac57 (diff)
downloadmariadb-git-cfa1ce81bb7992c362958bb95f41325ce2109834.tar.gz
MDEV-6551: Some replication errors are ignored if slave_parallel_threads > 0
The problem occured when using parallel replication, and an error occured that caused the SQL thread to stop when the IO thread had already reached a following binlog file from the master (or otherwise performed a relay log rotation). In this case, the Rotate Event at the end of the relay log file could still be executed, even though an earlier event in that relay log file had gotten an error. This would cause the position to be incorrectly updated, so that upon restart of the SQL thread, the event that had failed would be silently skipped and ignored, causing replication corruption. Fixed by checking before executing Rotate Event, whether an earlier event has failed. If so, the Rotate Event is not executed, just dequeued, same as for other normal events following a failing event.
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r--sql/rpl_parallel.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index 415259cd3c4..c7e15528e97 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -72,7 +72,15 @@ struct rpl_parallel_thread {
rpl_parallel_entry *current_entry;
struct queued_event {
queued_event *next;
- Log_event *ev;
+ /*
+ queued_event can hold either an event to be executed, or just a binlog
+ position to be updated without any associated event.
+ */
+ enum queued_event_t { QUEUED_EVENT, QUEUED_POS_UPDATE } typ;
+ union {
+ Log_event *ev; /* QUEUED_EVENT */
+ rpl_parallel_entry *entry_for_queued; /* QUEUED_POS_UPDATE */
+ };
rpl_group_info *rgi;
inuse_relaylog *ir;
ulonglong future_event_relay_log_pos;