From 0891948e7ff1b0506d49d57438e292f11232aedc Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 26 Jul 2012 09:07:46 -0700 Subject: [PATCH] filestore: add 'filestore fail eio' option, default true By default we will assert/fail/crash on EIO from the underlying fs. We already do this in the write path, but not the read path, or in various internal infrastructure. Signed-off-by: Sage Weil Conflicts: src/os/FileStore.cc --- src/common/config_opts.h | 1 + src/os/FileStore.cc | 6 +++++- src/os/FileStore.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 8ae36732a2340..af9213e07b69b 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -380,6 +380,7 @@ OPTION(filestore_update_to, OPT_INT, 1000) OPTION(filestore_blackhole, OPT_BOOL, false) // drop any new transactions on the floor OPTION(filestore_dump_file, OPT_STR, "") // file onto which store transaction dumps OPTION(filestore_kill_at, OPT_INT, 0) // inject a failure at the n'th opportunity +OPTION(filestore_fail_eio, OPT_BOOL, true) // fail/crash on EIO OPTION(journal_dio, OPT_BOOL, true) OPTION(journal_aio, OPT_BOOL, false) OPTION(journal_block_align, OPT_BOOL, true) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index a60ec3632b0fe..4116b4e190208 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -710,6 +710,7 @@ FileStore::FileStore(const std::string &base, const std::string &jdev, const cha m_filestore_flush_min(g_conf->filestore_flush_min), m_filestore_max_sync_interval(g_conf->filestore_max_sync_interval), m_filestore_min_sync_interval(g_conf->filestore_min_sync_interval), + m_filestore_fail_eio(g_conf->filestore_fail_eio), do_update(do_update), m_journal_dio(g_conf->journal_dio), m_journal_aio(g_conf->journal_aio), @@ -4710,6 +4711,7 @@ const char** FileStore::get_tracked_conf_keys() const "filestore_commit_timeout", "filestore_dump_file", "filestore_kill_at", + "filestore_fail_eio", NULL }; return KEYS; @@ -4722,7 +4724,8 @@ void FileStore::handle_conf_change(const struct md_config_t *conf, changed.count("filestore_max_sync_interval") || changed.count("filestore_flusher_max_fds") || changed.count("filestore_flush_min") || - changed.count("filestore_kill_at")) { + changed.count("filestore_kill_at") || + changed.count("filestore_fail_eio")) { Mutex::Locker l(lock); m_filestore_min_sync_interval = conf->filestore_min_sync_interval; m_filestore_max_sync_interval = conf->filestore_max_sync_interval; @@ -4731,6 +4734,7 @@ void FileStore::handle_conf_change(const struct md_config_t *conf, m_filestore_flush_min = conf->filestore_flush_min; m_filestore_sync_flush = conf->filestore_sync_flush; m_filestore_kill_at.set(conf->filestore_kill_at); + m_filestore_fail_eio = conf->filestore_fail_eio; } if (changed.count("filestore_commit_timeout")) { Mutex::Locker l(sync_entry_timeo_lock); diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 74e12eeaed18a..fdcc649e27b4c 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -490,6 +490,7 @@ private: int m_filestore_flush_min; double m_filestore_max_sync_interval; double m_filestore_min_sync_interval; + bool m_filestore_fail_eio; int do_update; bool m_journal_dio, m_journal_aio; std::string m_osd_rollback_to_cluster_snap; -- 2.39.5