Browse Source

MDEV-26547 fixup: Wait for read completion

buf_load(): Wait for the submitted reads to finish before updating
innodb_buffer_pool_load_status.
pull/1905/head
Marko Mäkelä 4 years ago
parent
commit
eb2f2c1e5f
  1. 4
      storage/innobase/buf/buf0dump.cc
  2. 4
      storage/innobase/include/os0file.h
  3. 14
      storage/innobase/os/os0file.cc

4
storage/innobase/buf/buf0dump.cc

@ -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) {

4
storage/innobase/include/os0file.h

@ -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

14
storage/innobase/os/os0file.cc

@ -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

Loading…
Cancel
Save