MDEV-34543 Shutdown hangs while freeing the asynchronous i/o slots

Problem:
========
- During shutdown, InnoDB tries to free the asynchronous
I/O slots and hangs. The reason is that InnoDB disables
asynchronous I/O before waiting for pending
asynchronous I/O to finish.

buf_load(): InnoDB aborts the buffer pool load due to
user requested shutdown and doesn't wait for the asynchronous
read to get completed. This could lead to debug assertion
in buf_flush_buffer_pool() during shutdown

Fix:
===
os_aio_free(): Should wait all read_slots and write_slots
to finish before disabling the aio.

buf_load(): Should wait for pending read request to complete
even though it was aborted.
parent e8bcc4e4
......@@ -643,9 +643,7 @@ buf_load()
ut_free(dump);
if (i == dump_n) {
os_aio_wait_until_no_pending_reads();
}
os_aio_wait_until_no_pending_reads();
ut_sprintf_timestamp(now);
......
......@@ -3752,11 +3752,11 @@ int os_aio_init()
void os_aio_free()
{
srv_thread_pool->disable_aio();
delete read_slots;
delete write_slots;
read_slots= nullptr;
write_slots= nullptr;
srv_thread_pool->disable_aio();
}
/** Wait until there are no pending asynchronous writes. */
......
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