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

MDEV-13542: Implement page read fault injection

--debug-dbug=d,intermittent_read_failure is effective after the
database has been started up.

--debug-dbug=d,intermittent_recovery_failure is always effective,
including during recovery.
parent 0b47c126
......@@ -2834,6 +2834,14 @@ fil_io_t fil_space_t::io(const IORequest &type, os_offset_t offset, size_t len,
goto release;
}
DBUG_EXECUTE_IF("intermittent_recovery_failure",
if (type.is_read() && !(~get_rnd_value() & 0x3ff0))
goto io_error;);
DBUG_EXECUTE_IF("intermittent_read_failure",
if (srv_was_started && type.is_read() &&
!(~get_rnd_value() & 0x3ff0)) goto io_error;);
if (UNIV_LIKELY_NULL(UT_LIST_GET_NEXT(chain, node))) {
ut_ad(this == fil_system.sys_space
|| this == fil_system.temp_space);
......@@ -2850,7 +2858,9 @@ fil_io_t fil_space_t::io(const IORequest &type, os_offset_t offset, size_t len,
offset, len,
type.is_read());
}
#ifndef DBUG_OFF
io_error:
#endif
set_corrupted();
err = DB_IO_ERROR;
node = nullptr;
......
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