summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2017-06-19 06:37:43 +0300
committerSergei Golubchik <serg@mariadb.org>2017-08-24 01:05:50 +0200
commitf71bed08caa6956fa3231900e70eaec6161ad33e (patch)
treecd40a3016ee5dfa16bb8e7ff7fa259d1971b98cd /sql/rpl_parallel.cc
parent458d5ed8aabc60e6540de8fb9e94fb0577612fa1 (diff)
downloadmariadb-git-f71bed08caa6956fa3231900e70eaec6161ad33e.tar.gz
Safety fix: lock binlog_end_pos before calling signal_update
The mutex is needed to ensure that sql thread should not not miss the error signal.
Diffstat (limited to 'sql/rpl_parallel.cc')
-rw-r--r--sql/rpl_parallel.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 5797b82d8fe..b274824a33b 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -256,7 +256,9 @@ signal_error_to_sql_driver_thread(THD *thd, rpl_group_info *rgi, int err)
rgi->rli->stop_for_until= false;
mysql_mutex_lock(rgi->rli->relay_log.get_log_lock());
mysql_mutex_unlock(rgi->rli->relay_log.get_log_lock());
+ rgi->rli->relay_log.lock_binlog_end_pos();
rgi->rli->relay_log.signal_update();
+ rgi->rli->relay_log.unlock_binlog_end_pos();
}