mirror of
https://github.com/MariaDB/server.git
synced 2026-05-17 20:37:12 +02:00
MDEV-38271 Server hangs during concurrent set innodb_encryption_threads
Problem: ======= - Multiple user threads waits for all encryption threads to start before returing the control to user. But in fil_crypt_thread(), InnoDB signals that thread is started after incrementing srv_n_fil_crypt_threads_started variable. For multiple waiters, pthread_cond_broadcast() would be more appropriate as it wakes all waiting threads. Solution: ======== fil_crypt_thread(): Use pthread_cond_broadcast instead of pthread_cond_signal(fil_crypt_cond) to wake multiple waiter threads
This commit is contained in:
parent
5d2da8ef1e
commit
6892722577
1 changed files with 2 additions and 2 deletions
|
|
@ -2021,7 +2021,7 @@ static void fil_crypt_thread()
|
|||
#endif /* UNIV_PFS_THREAD */
|
||||
mysql_mutex_lock(&fil_crypt_threads_mutex);
|
||||
rotate_thread_t thr(srv_n_fil_crypt_threads_started++);
|
||||
pthread_cond_signal(&fil_crypt_cond); /* signal that we started */
|
||||
pthread_cond_broadcast(&fil_crypt_cond);
|
||||
|
||||
if (!thr.should_shutdown()) {
|
||||
/* if we find a tablespace that is starting, skip over it
|
||||
|
|
@ -2093,7 +2093,7 @@ wait_for_work:
|
|||
|
||||
fil_crypt_return_iops(&thr);
|
||||
srv_n_fil_crypt_threads_started--;
|
||||
pthread_cond_signal(&fil_crypt_cond); /* signal that we stopped */
|
||||
pthread_cond_broadcast(&fil_crypt_cond);
|
||||
mysql_mutex_unlock(&fil_crypt_threads_mutex);
|
||||
|
||||
my_thread_end();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue