summaryrefslogtreecommitdiff
path: root/sql/thread_pool_info.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2020-03-28 01:46:53 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2020-03-28 01:46:53 +0100
commite129555462e3464e5274c5d5bab19defa1592d3a (patch)
treec1b93e51cb621668f666e51761623c18cef15a0e /sql/thread_pool_info.cc
parentf991c41670623d89542e10bc30fd2f78e213a375 (diff)
downloadmariadb-git-e129555462e3464e5274c5d5bab19defa1592d3a.tar.gz
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.
Diffstat (limited to 'sql/thread_pool_info.cc')
-rw-r--r--sql/thread_pool_info.cc11
1 files changed, 7 insertions, 4 deletions
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];