From 5a1297d3af323cb2237c192e0fd4199d9e5bb275 Mon Sep 17 00:00:00 2001 From: Kaige Ye Date: Fri, 23 Jul 2021 15:11:13 +0800 Subject: [PATCH] fix fts_optimize_thread missing in performance_schema.threads --- storage/innobase/fts/fts0opt.cc | 6 +++++- storage/innobase/handler/ha_innodb.cc | 1 + storage/innobase/include/srv0srv.h | 1 + storage/innobase/srv/srv0start.cc | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index 31431c081e32..a46056d3f6c9 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -2851,7 +2851,7 @@ fts_optimize_sync_table( Optimize all FTS tables. @return Dummy return */ os_thread_ret_t -fts_optimize_thread( +DECLARE_THREAD(fts_optimize_thread)( /*================*/ void* arg) /*!< in: work queue*/ { @@ -2864,6 +2864,10 @@ fts_optimize_thread( ut_ad(!srv_read_only_mode); my_thread_init(); +#ifdef UNIV_PFS_THREAD + pfs_register_thread(fts_optimize_thread_key); +#endif /* UNIV_PFS_THREAD */ + ut_ad(fts_slots); /* Assign number of tables added in fts_slots_t to n_tables */ diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 413d2e21baab..680ac4c3c3aa 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -503,6 +503,7 @@ static PSI_thread_info all_innodb_threads[] = { PSI_KEY(srv_purge_thread), PSI_KEY(srv_worker_thread), PSI_KEY(trx_rollback_clean_thread), + PSI_KEY(fts_optimize_thread), }; # endif /* UNIV_PFS_THREAD */ diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 3bf9eb93131a..6af080968fd4 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -490,6 +490,7 @@ extern mysql_pfs_key_t srv_monitor_thread_key; extern mysql_pfs_key_t srv_purge_thread_key; extern mysql_pfs_key_t srv_worker_thread_key; extern mysql_pfs_key_t trx_rollback_clean_thread_key; +extern mysql_pfs_key_t fts_optimize_thread_key; /* This macro register the current thread and its key with performance schema */ diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index b404b2068357..8fc42650de7c 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -198,6 +198,7 @@ mysql_pfs_key_t srv_master_thread_key; mysql_pfs_key_t srv_monitor_thread_key; mysql_pfs_key_t srv_purge_thread_key; mysql_pfs_key_t srv_worker_thread_key; +mysql_pfs_key_t fts_optimize_thread_key; #endif /* UNIV_PFS_THREAD */ #ifdef HAVE_PSI_STAGE_INTERFACE