1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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
parent dffe3d1fb2
commit 746471b8d8
5 changed files with 13 additions and 0 deletions

View File

@@ -6,4 +6,5 @@ WHERE name LIKE 'thread/innodb/%'
GROUP BY name;
name type processlist_user processlist_host processlist_db processlist_command processlist_time processlist_state processlist_info parent_thread_id role instrumented
thread/innodb/page_cleaner_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
thread/innodb/page_encrypt_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES
thread/innodb/thread_pool_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES

View File

@@ -0,0 +1 @@
--innodb-encryption-threads=2

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;