summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2022-01-24 13:53:38 +1100
committerDaniel Black <daniel@mariadb.org>2022-01-24 13:56:27 +1100
commit2d408c0f6ec668eee918fa3a34413164cbac748b (patch)
tree4477bda11e56d008449875472e49c47a8441ec1c
parente4b302e436c0a1e0d477a8e8e8e513112fd3ec7f (diff)
downloadmariadb-git-preview-10.5-MDEV-27593-innodb-aio-error-message.tar.gz
MDEV-27593 InnoDB handle AIO errors with message rather than assertionpreview-10.5-MDEV-27593-innodb-aio-error-message
Here we use an ib::fatal error message to describe the error like: 2022-01-24 13:45:50 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1365013530,1382455208 2022-01-24 13:45:50 0 [Note] InnoDB: Starting a batch to recover 4410 pages from redo log. 2022-01-24 13:45:51 0 [ERROR] [FATAL] InnoDB: IO Error No space left on device on file descriptor 10 writing 2097152 bytes at offset 1048576 220124 13:45:51 [ERROR] mysqld got signal 6 ; rather than 2022-01-24 12:09:33 0x7f7a8dffb640 InnoDB: Assertion failure in file /home/dan/repos/mariadb-server-10.8/storage/innobase/os/os0file.cc line 3596 InnoDB: Failing assertion: cb->m_err == DB_SUCCESS
-rw-r--r--storage/innobase/os/os0file.cc32
1 files changed, 19 insertions, 13 deletions
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 32c31b191ed..b22d3c678cd 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -3619,22 +3619,28 @@ extern void fil_aio_callback(const IORequest &request);
static void io_callback(tpool::aiocb* cb)
{
- ut_a(cb->m_err == DB_SUCCESS);
- const IORequest request(*static_cast<const IORequest*>
- (static_cast<const void*>(cb->m_userdata)));
- /* Return cb back to cache*/
- if (cb->m_opcode == tpool::aio_opcode::AIO_PREAD)
- {
- ut_ad(read_slots->contains(cb));
- read_slots->release(cb);
- }
+ if (cb->m_err != DB_SUCCESS)
+ ib::fatal() << "IO Error " << strerror(cb->m_err) << " on file descriptor "
+ << cb->m_fh << (cb->m_opcode == tpool::aio_opcode::AIO_PREAD ? " reading "
+ : " writing ") << cb->m_len << " bytes at offset " << cb->m_offset;
else
{
- ut_ad(write_slots->contains(cb));
- write_slots->release(cb);
- }
+ const IORequest request(*static_cast<const IORequest*>
+ (static_cast<const void*>(cb->m_userdata)));
+ /* Return cb back to cache*/
+ if (cb->m_opcode == tpool::aio_opcode::AIO_PREAD)
+ {
+ ut_ad(read_slots->contains(cb));
+ read_slots->release(cb);
+ }
+ else
+ {
+ ut_ad(write_slots->contains(cb));
+ write_slots->release(cb);
+ }
- fil_aio_callback(request);
+ fil_aio_callback(request);
+ }
}
#ifdef LINUX_NATIVE_AIO