From e129555462e3464e5274c5d5bab19defa1592d3a Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sat, 28 Mar 2020 01:46:53 +0100 Subject: MDEV-20372 thread_pool_info fails randomly in 10.5 Rework stats a bit, so we're not missing any queue_get() now. Don't do stats_reset_table(), if generic threadpool is off. --- sql/thread_pool_info.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sql/thread_pool_info.cc') diff --git a/sql/thread_pool_info.cc b/sql/thread_pool_info.cc index 99ac3cd148c..cf9ffe94f94 100644 --- a/sql/thread_pool_info.cc +++ b/sql/thread_pool_info.cc @@ -194,10 +194,10 @@ static int stats_fill_table(THD* thd, TABLE_LIST* tables, COND*) table->field[4]->store(counters->wakes_due_to_stall, true); table->field[5]->store(counters->throttles, true); table->field[6]->store(counters->stalls, true); - table->field[7]->store(counters->polls_by_listener, true); - table->field[8]->store(counters->polls_by_worker, true); - table->field[9]->store(counters->dequeues_by_listener, true); - table->field[10]->store(counters->dequeues_by_worker, true); + table->field[7]->store(counters->polls[(int)operation_origin::LISTENER], true); + table->field[8]->store(counters->polls[(int)operation_origin::WORKER], true); + table->field[9]->store(counters->dequeues[(int)operation_origin::LISTENER], true); + table->field[10]->store(counters->dequeues[(int)operation_origin::WORKER], true); mysql_mutex_unlock(&group->mutex); if (schema_table_store_record(thd, table)) return 1; @@ -207,6 +207,9 @@ static int stats_fill_table(THD* thd, TABLE_LIST* tables, COND*) static int stats_reset_table() { + if (!all_groups) + return 0; + for (uint i = 0; i < threadpool_max_size && all_groups[i].pollfd != INVALID_HANDLE_VALUE; i++) { thread_group_t* group = &all_groups[i]; -- cgit v1.2.1