diff options
-rw-r--r-- | sql/rpl_parallel.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 973b9d899c1..34f9113f7fe 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -1623,10 +1623,19 @@ int rpl_parallel_resize_pool_if_no_slaves(void) } +/** + Resize pool if not active or busy (in which case we may be in + resize to 0 +*/ + int rpl_parallel_activate_pool(rpl_parallel_thread_pool *pool) { - if (!pool->count) + bool resize; + mysql_mutex_lock(&pool->LOCK_rpl_thread_pool); + resize= !pool->count || pool->busy; + mysql_mutex_unlock(&pool->LOCK_rpl_thread_pool); + if (resize) return rpl_parallel_change_thread_count(pool, opt_slave_parallel_threads, 0); return 0; |