MDEV-33978 P_S.THREADS is not showing all server threads

page_encrypt_thread_key: The key for fil_crypt_thread().

All other InnoDB threads should already have been registered for
performance_schema ever since
commit a2f510fccf
This commit is contained in:
Marko Mäkelä 2025-01-27 12:11:47 +02:00
commit 746471b8d8
5 changed files with 13 additions and 0 deletions

View file

@ -80,6 +80,10 @@ static uint n_fil_crypt_iops_allocated = 0;
#define DEBUG_KEYROTATION_THROTTLING 0
#ifdef UNIV_PFS_THREAD
mysql_pfs_key_t page_encrypt_thread_key;
#endif /* UNIV_PFS_THREAD */
/** Statistics variables */
static fil_crypt_stat_t crypt_stat;
static ib_mutex_t crypt_stat_mutex;
@ -2145,6 +2149,10 @@ extern "C" UNIV_INTERN
os_thread_ret_t
DECLARE_THREAD(fil_crypt_thread)(void*)
{
my_thread_init();
#ifdef UNIV_PFS_THREAD
pfs_register_thread(page_encrypt_thread_key);
#endif /* UNIV_PFS_THREAD */
mutex_enter(&fil_crypt_threads_mutex);
uint thread_no = srv_n_fil_crypt_threads_started;
srv_n_fil_crypt_threads_started++;
@ -2242,6 +2250,7 @@ DECLARE_THREAD(fil_crypt_thread)(void*)
/* We count the number of threads in os_thread_exit(). A created
thread should always use that to exit and not use return() to exit. */
my_thread_end();
return os_thread_exit();
}

View file

@ -579,6 +579,7 @@ performance schema instrumented if "UNIV_PFS_THREAD"
is defined */
static PSI_thread_info all_innodb_threads[] = {
PSI_KEY(page_cleaner_thread),
PSI_KEY(page_encrypt_thread),
PSI_KEY(trx_rollback_clean_thread),
PSI_KEY(thread_pool_thread)
};

View file

@ -469,6 +469,7 @@ extern ulong srv_buf_dump_status_frequency;
# ifdef UNIV_PFS_THREAD
extern mysql_pfs_key_t page_cleaner_thread_key;
extern mysql_pfs_key_t page_encrypt_thread_key;
extern mysql_pfs_key_t trx_rollback_clean_thread_key;
extern mysql_pfs_key_t thread_pool_thread_key;