]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: implement filestore_blackhole hook
authorSage Weil <sage.weil@dreamhost.com>
Tue, 31 Jan 2012 01:39:23 +0000 (17:39 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 31 Jan 2012 15:23:39 +0000 (07:23 -0800)
If true, we'll drop any new transactions on the floor. Useful for
triggering failure conditions (e.g., prior to killing ceph-osd itself, to
ensure some operations don't reach the local disk).

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/common/config_opts.h
src/os/FileStore.cc

index 2b29f7358b886b996b716aeb558eb3b35c77530e..fa88178b570e86e1b2b18ec682a16489436d0841 100644 (file)
@@ -325,6 +325,7 @@ OPTION(filestore_fiemap_threshold, OPT_INT, 4096)
 OPTION(filestore_merge_threshold, OPT_INT, 10)
 OPTION(filestore_split_multiple, OPT_INT, 2)
 OPTION(filestore_update_collections, OPT_BOOL, false)
+OPTION(filestore_blackhole, OPT_BOOL, false)     // drop any new transactions on the floor
 OPTION(journal_dio, OPT_BOOL, true)
 OPTION(journal_block_align, OPT_BOOL, true)
 OPTION(journal_max_write_bytes, OPT_INT, 10 << 20)
index ee25ace48759c9d11a75c32376cff9ecaea30120..73329ee48b9bb3819f8bb1441f4b9c61c0e5ca61 100644 (file)
@@ -2016,6 +2016,11 @@ int FileStore::queue_transactions(Sequencer *posr, list<Transaction*> &tls,
                                  Context *onreadable, Context *ondisk,
                                  Context *onreadable_sync)
 {
+  if (g_conf->filestore_blackhole) {
+    dout(0) << "queue_transactions filestore_blackhole = TRUE, dropping transaction" << dendl;
+    return 0;
+  }
+
   // set up the sequencer
   OpSequencer *osr;
   if (!posr)