Skip to content
Permalink
Browse files
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.
  • Loading branch information
dr-m committed Jun 6, 2022
1 parent 0b47c12 commit cc4eabc
Showing 1 changed file with 11 additions and 1 deletion.
@@ -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;

0 comments on commit cc4eabc

Please sign in to comment.