]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: add 'filestore fail eio' option, default true
authorSage Weil <sage@inktank.com>
Thu, 26 Jul 2012 16:07:46 +0000 (09:07 -0700)
committerSage Weil <sage@inktank.com>
Fri, 27 Jul 2012 04:29:13 +0000 (21:29 -0700)
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 <sage@inktank.com>
Conflicts:

src/os/FileStore.cc

src/common/config_opts.h
src/os/FileStore.cc
src/os/FileStore.h

index 8ae36732a2340500fd2445de4255fefdbd9358a2..af9213e07b69be4db10b2e81bcde1b875512b4e9 100644 (file)
@@ -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)
index a60ec3632b0fee4973f672a0f6de41797777a805..4116b4e190208f63b2e090e2eae28abb51426ec7 100644 (file)
@@ -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);
index 74e12eeaed18ab62bbc2bffe673d4563cf4e8281..fdcc649e27b4cc964458b17aee886c9292a560e3 100644 (file)
@@ -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;