diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2016-09-20 15:30:57 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2016-10-14 22:44:40 +0200 |
commit | 50f19ca8099994e992e1b411c7c05287855a7bdd (patch) | |
tree | 7616768e8db48e1a83c8f20699e717731c7f741f /sql/slave.h | |
parent | 7e0c9de86484815b6e014ce3ad3e3a9b74ec0ce0 (diff) | |
download | mariadb-git-50f19ca8099994e992e1b411c7c05287855a7bdd.tar.gz |
Remove unnecessary global mutex in parallel replication.
The function apply_event_and_update_pos() is called with the
rli->data_lock mutex held. However, there seems to be nothing in the
function actually needing the mutex to be held. Certainly not in the
parallel replication case, where sql_slave_skip_counter is always 0
since the non-zero case is handled by the SQL driver thread.
So this patch makes parallel replication use a variant of
apply_event_and_update_pos() without the need to take the
rli->data_lock mutex. This avoids one contended global mutex for each
event executed, which might improve performance on CPU-bound workloads
somewhat.
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
Diffstat (limited to 'sql/slave.h')
-rw-r--r-- | sql/slave.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/slave.h b/sql/slave.h index e8a925ce560..a78ae4cff6f 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -243,8 +243,9 @@ void set_slave_thread_default_charset(THD *thd, rpl_group_info *rgi); int rotate_relay_log(Master_info* mi); int has_temporary_error(THD *thd); int apply_event_and_update_pos(Log_event* ev, THD* thd, - struct rpl_group_info *rgi, - rpl_parallel_thread *rpt); + struct rpl_group_info *rgi); +int apply_event_and_update_pos_for_parallel(Log_event* ev, THD* thd, + struct rpl_group_info *rgi); pthread_handler_t handle_slave_io(void *arg); void slave_output_error_info(rpl_group_info *rgi, THD *thd); |