MDEV-23410 buf_LRU_scan_and_free_block() fails to stop at first freed block

An unfortunate performance regression was introduced in
commit b1ab211dee (MDEV-15053)
that affects workloads where the working set is larger than
the buffer pool.

We used to terminate the loop in buf_LRU_scan_and_free_block()
when we succeeded to free a replaceable buffer pool block.
Due to the regression, we would keep freeing all replaceable
blocks until we reach the end of the list or encounter a block
that had never been accessed because it had been brought in
by read-ahead.
This commit is contained in:
Marko Mäkelä 2020-08-05 19:59:50 +03:00 committed by Sergei Golubchik
parent 72f677d302
commit e081415040

View file

@ -570,8 +570,9 @@ static bool buf_LRU_free_from_common_LRU_list(bool scan_all)
ever being accessed. This gives us a measure of
the effectiveness of readahead */
++buf_pool.stat.n_ra_pages_evicted;
break;
}
break;
}
}