diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/rpl_parallel.cc | 7 | ||||
-rw-r--r-- | sql/rpl_parallel.h | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index ce3170bb774..6c8c5b5c3fa 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -647,11 +647,12 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev) still executing the first ones, to be able to start executing a large event group without having to wait for the end to be fetched from the master. And we continue to queue up more events after the first group, - avoiding the overhead of worker threads constantly entering and - leaving the worker thread free list. + so that we can continue to process subsequent parts of the relay log in + parallel without having to wait for previous long-running events to + complete. But if the worker thread is idle at any point, it may return to the - idle list or be servicing a different request. So check this, and + idle list or start servicing a different request. So check this, and allocate a new thread if the old one is no longer processing for us. */ cur_thread= e->rpl_thread; diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h index 1edce8f047d..8dfd0297199 100644 --- a/sql/rpl_parallel.h +++ b/sql/rpl_parallel.h @@ -57,6 +57,10 @@ struct rpl_parallel_entry { uint64 last_committed_sub_id; mysql_mutex_t LOCK_parallel_entry; mysql_cond_t COND_parallel_entry; + /* + The sub_id of the last event group in this replication domain that was + queued for execution by a worker thread. + */ uint64 current_sub_id; rpl_group_info *current_group_info; /* |