summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.cc
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2016-11-16 11:00:38 +0100
committerRasmus Johansson <rasmus@mariadb.com>2016-11-17 12:32:13 +0200
commit7618e953e960a374f555b93be99cbad9af7ba503 (patch)
tree4809a67bda0584859199123d7b70f0ba3843a7ed /sql/rpl_parallel.cc
parent7dd9be0fa1536c6c2fb580a570f5c44b58a4d0a4 (diff)
downloadmariadb-git-bb-10.0-MDEV-10863.tar.gz
Fix incorrect reading of events from relaylog in parallel replication.bb-10.0-MDEV-10863
The SQL thread keeps track of the position in the current relay log from which to read the next event. This position is not normally used, but a certain interaction with the IO thread can cause the SQL thread to re-open the relay log and seek to the stored position. In parallel replication, there were a couple of places where the position was not updated. This created a race where a re-open of the relay log could seek to the wrong position and start re-reading and processing events already handled once, causing various kinds of problems. Fix this by moving the position update into a single place in apply_event_and_update_pos(), which should ensure that the position is always updated in the parallel replication case. This problem was found from the testcase of MDEV-10863, but it is logically a separate problem.
Diffstat (limited to 'sql/rpl_parallel.cc')
-rw-r--r--sql/rpl_parallel.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 98712f18c1b..23f61a82a90 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -2614,7 +2614,6 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
/*
Queue the event for processing.
*/
- rli->event_relay_log_pos= rli->future_event_relay_log_pos;
qev->ir= rli->last_inuse_relaylog;
++qev->ir->queued_count;
cur_thread->enqueue(qev);