mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-11176: FTWRL confusing state about "worker thread pool"
The FLUSH TABLE WITH READ LOCK briefly set the state (in PROCESSLIST) to "Waiting while replication worker thread pool is busy", even if there was nothing to wait for. This is somewhat confusing on a server that might not even have any replication configured, let alone replication workers. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
@@ -10,7 +10,6 @@ username event_name nesting_event_type
|
||||
username event_name nesting_event_type
|
||||
user1 stage/sql/starting STATEMENT
|
||||
user1 stage/sql/starting STATEMENT
|
||||
user1 stage/sql/starting STATEMENT
|
||||
user1 stage/sql/Query end STATEMENT
|
||||
user1 stage/sql/closing tables STATEMENT
|
||||
user1 stage/sql/Query end STATEMENT
|
||||
|
@@ -552,6 +552,7 @@ pool_mark_busy(rpl_parallel_thread_pool *pool, THD *thd)
|
||||
{
|
||||
PSI_stage_info old_stage;
|
||||
int res= 0;
|
||||
bool did_enter_cond= false;
|
||||
|
||||
/*
|
||||
Wait here while the queue is busy. This is done to make FLUSH TABLES WITH
|
||||
@@ -568,13 +569,16 @@ pool_mark_busy(rpl_parallel_thread_pool *pool, THD *thd)
|
||||
*/
|
||||
DBUG_EXECUTE_IF("mark_busy_mdev_22370",my_sleep(1000000););
|
||||
mysql_mutex_lock(&pool->LOCK_rpl_thread_pool);
|
||||
if (pool->busy)
|
||||
{
|
||||
if (thd)
|
||||
{
|
||||
thd->set_time_for_next_stage();
|
||||
thd->ENTER_COND(&pool->COND_rpl_thread_pool, &pool->LOCK_rpl_thread_pool,
|
||||
&stage_waiting_for_rpl_thread_pool, &old_stage);
|
||||
did_enter_cond= true;
|
||||
}
|
||||
while (pool->busy)
|
||||
do
|
||||
{
|
||||
if (thd && unlikely(thd->check_killed()))
|
||||
{
|
||||
@@ -582,10 +586,11 @@ pool_mark_busy(rpl_parallel_thread_pool *pool, THD *thd)
|
||||
break;
|
||||
}
|
||||
mysql_cond_wait(&pool->COND_rpl_thread_pool, &pool->LOCK_rpl_thread_pool);
|
||||
} while (pool->busy);
|
||||
}
|
||||
if (!res)
|
||||
pool->busy= true;
|
||||
if (thd)
|
||||
if (did_enter_cond)
|
||||
thd->EXIT_COND(&old_stage);
|
||||
else
|
||||
mysql_mutex_unlock(&pool->LOCK_rpl_thread_pool);
|
||||
|
Reference in New Issue
Block a user