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/rpl_parallel.cc | |
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/rpl_parallel.cc')
-rw-r--r-- | sql/rpl_parallel.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 761471fc1cb..c507a132374 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -47,9 +47,7 @@ rpt_handle_event(rpl_parallel_thread::queued_event *qev, if (!(ev->is_artificial_event() || ev->is_relay_log_event() || (ev->when == 0))) rgi->last_master_timestamp= ev->when + (time_t)ev->exec_time; - mysql_mutex_lock(&rli->data_lock); - /* Mutex will be released in apply_event_and_update_pos(). */ - err= apply_event_and_update_pos(ev, thd, rgi, rpt); + err= apply_event_and_update_pos_for_parallel(ev, thd, rgi); thread_safe_increment64(&rli->executed_entries); /* ToDo: error handling. */ |