From f2799c68286c5742b5dbdeb65942494ff2ba38af Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 29 Oct 2013 11:52:16 +0100 Subject: [PATCH] MDEV-5195: Race when switching relay log causing crash In parallel replication, when the IO thread switches relay log, the SQL thread re-opens the current relaylog and seeks to the current position. There was a race that would cause it to sometimes seek to the wrong position, causing corruption and crash. --- sql/rpl_parallel.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index bbc917b6e9d..97e115cc79f 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -835,6 +835,7 @@ 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; cur_thread->enqueue(qev); mysql_mutex_unlock(&cur_thread->LOCK_rpl_thread); mysql_cond_signal(&cur_thread->COND_rpl_thread);