summaryrefslogtreecommitdiff
path: root/storage/innobase/fil/fil0fil.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-06-06 14:04:45 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-06-06 14:04:45 +0300
commitcc4eabc7b276fd27044ed42bd32c4f58c45b924d (patch)
treeb0e58a48c1e5692088dd769d8e30914780cef947 /storage/innobase/fil/fil0fil.cc
parent0b47c126e31cddda1e94588799599e138400bcf8 (diff)
downloadmariadb-git-cc4eabc7b276fd27044ed42bd32c4f58c45b924d.tar.gz
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.
Diffstat (limited to 'storage/innobase/fil/fil0fil.cc')
-rw-r--r--storage/innobase/fil/fil0fil.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index f91d127215f..703638f2b7c 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -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 @@ fail:
offset, len,
type.is_read());
}
-
+#ifndef DBUG_OFF
+io_error:
+#endif
set_corrupted();
err = DB_IO_ERROR;
node = nullptr;