MDEV-31084 assert(waiting) failed in TP_connection_generic::wait_end

buf_flush_wait_flushed(): Correct the logic for registering a wait
around buf_flush_wait() that
commit a091d6ac4e
recently broke. This should be easily repeatable when using a
non-default startup parameter:

	thread-handling=pool-of-threads
This commit is contained in:
Marko Mäkelä 2023-04-21 16:49:59 +03:00
parent abe4c7bfd6
commit e55e761eae

View file

@ -1905,9 +1905,13 @@ ATTRIBUTE_COLD void buf_flush_wait_flushed(lsn_t sync_lsn)
}
else
#endif
{
thd_wait_begin(nullptr, THD_WAIT_DISKIO);
tpool::tpool_wait_begin();
buf_flush_wait(sync_lsn);
thd_wait_end(nullptr);
tpool::tpool_wait_end();
thd_wait_end(nullptr);
}
}
mysql_mutex_unlock(&buf_pool.flush_list_mutex);