Commit eb2f2c1e authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-26547 fixup: Wait for read completion

buf_load(): Wait for the submitted reads to finish before updating
innodb_buffer_pool_load_status.
parent b729c1a1
......@@ -715,6 +715,10 @@ buf_load()
ut_free(dump);
if (i == dump_n) {
os_aio_wait_until_no_pending_reads();
}
ut_sprintf_timestamp(now);
if (i == dump_n) {
......
......@@ -1116,6 +1116,10 @@ Only used on FLUSH TABLES...FOR EXPORT. */
void os_aio_wait_until_no_pending_writes();
/** Wait until there are no pending asynchronous reads. */
void os_aio_wait_until_no_pending_reads();
/** Prints info of the aio arrays.
@param[in/out] file file where to print */
void
......
......@@ -3828,6 +3828,20 @@ void os_aio_wait_until_no_pending_writes()
buf_dblwr.wait_flush_buffered_writes();
}
/** Wait until there are no pending asynchronous reads. */
void os_aio_wait_until_no_pending_reads()
{
const auto notify_wait= read_slots->pending_io_count();
if (notify_wait)
tpool::tpool_wait_begin();
read_slots->wait();
if (notify_wait)
tpool::tpool_wait_end();
}
/** Request a read or write.
@param type I/O request
@param buf buffer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment