MDEV-29445 fixup: Make Valgrind fair again

recv_sys_t::wait_for_pool(): Also wait for pending writes, so that
previously written blocks can be evicted and reused.

buf_flush_sync_for_checkpoint(): Wait for pending writes, in order
to guarantee progress even if the scheduler is unfair.
This commit is contained in:
Marko Mäkelä 2025-03-27 14:52:07 +02:00
commit 027d815546
2 changed files with 3 additions and 0 deletions

View file

@ -2195,6 +2195,8 @@ static void buf_flush_sync_for_checkpoint(lsn_t lsn) noexcept
MONITOR_FLUSH_SYNC_PAGES, n_flushed);
}
os_aio_wait_until_no_pending_writes(false);
switch (srv_file_flush_method) {
case SRV_NOSYNC:
case SRV_O_DIRECT_NO_FSYNC:

View file

@ -2041,6 +2041,7 @@ ATTRIBUTE_COLD void recv_sys_t::wait_for_pool(size_t pages)
{
mysql_mutex_unlock(&mutex);
os_aio_wait_until_no_pending_reads(false);
os_aio_wait_until_no_pending_writes(false);
mysql_mutex_lock(&mutex);
garbage_collect();
mysql_mutex_lock(&buf_pool.mutex);