diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-11-13 10:09:46 +0100 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-11-13 10:09:46 +0100 |
commit | 8a3e2f29bb1a0ec1c0104a8877ce9f9d507cfcf3 (patch) | |
tree | 0d8e2b32a02bc361f95f1f6db0022f85f8cc957a /sql/slave.h | |
parent | a98a034c5e8bd4cac8794bb59e6fce138344ce0c (diff) | |
download | mariadb-git-8a3e2f29bb1a0ec1c0104a8877ce9f9d507cfcf3.tar.gz |
MDEV-6718: Server crashed in Gtid_log_event::Gtid_log_event with parallel replication
The bug occured in parallel replication when re-trying transactions that
failed due to deadlock. In this case, the relay log file is re-opened and the
events are read out again. This reading requires a format description event of
the appropriate version. But the code was using a description event stored in
rli, which is not thread-safe. This could lead to various rare races if the
format description event was replaced by the SQL driver thread at the exact
moment where a worker thread was trying to use it.
The fix is to instead make the retry code create and maintain its own format
description event. When the relay log file is opened, we first read the format
description event from the start of the file, before seeking to the current
position. This now uses the same code as when the SQL driver threads starts
from a given relay log position. This also makes sure that the correct format
description event version will be used in cases where the version of the
binlog could change during replication.
Diffstat (limited to 'sql/slave.h')
-rw-r--r-- | sql/slave.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/slave.h b/sql/slave.h index e65b4a589a1..e16f801b577 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -220,6 +220,10 @@ void end_relay_log_info(Relay_log_info* rli); void lock_slave_threads(Master_info* mi); void unlock_slave_threads(Master_info* mi); void init_thread_mask(int* mask,Master_info* mi,bool inverse); +Format_description_log_event * +read_relay_log_description_event(IO_CACHE *cur_log, ulonglong start_pos, + const char **errmsg); + int init_relay_log_pos(Relay_log_info* rli,const char* log,ulonglong pos, bool need_data_lock, const char** errmsg, bool look_for_description_event); |