]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add option for bluestore fail eio 43232/head
authorhaoyixing <haoyixing@kuaishou.com>
Sat, 18 Sep 2021 09:48:12 +0000 (17:48 +0800)
committerhaoyixing <haoyixing@kuaishou.com>
Tue, 28 Sep 2021 02:44:47 +0000 (10:44 +0800)
PR #17744 allows eio for _do_read in bluestore, but didn't leave it as
an option. Since we can choose to fail for filestore on eio, maybe bluestore
can also have an option.

Signed-off-by: haoyixing <haoyixing@kuaishou.com>
src/common/options/global.yaml.in
src/os/bluestore/BlueStore.cc

index 09a2fdd02b4093cc1f6930f52de286f0f7f3b234..f65493199ed3a6ec0ba92e4dcdd2fd526d77eaf9 100644 (file)
@@ -5205,6 +5205,15 @@ options:
   flags:
   - runtime
   with_legacy: true
+- name: bluestore_fail_eio
+  type: bool
+  level: dev
+  desc: fail/crash on EIO
+  long_desc: whether bluestore osd fails on eio
+  default: false
+  flags:
+  - runtime
+  with_legacy: true
 - name: kstore_max_ops
   type: uint
   level: advanced
index e8fb4fe3739ddedf2546463560aeaed4d4c961b0..e1839ba188444bf79417638cdb4e1e7ecf6cc9b1 100644 (file)
@@ -8762,7 +8762,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
            }
 
            bufferlist bl;
-           IOContext ioc(cct, NULL, true); // allow EIO
+           IOContext ioc(cct, NULL, !cct->_conf->bluestore_fail_eio);
            r = bdev->read(e->offset, e->length, &bl, &ioc, false);
            if (r < 0) {
              derr << __func__ << " failed to read from 0x" << std::hex << e->offset
@@ -10180,7 +10180,7 @@ int BlueStore::_do_read(
                              // measure the whole block below.
                              // The error isn't that much...
   vector<bufferlist> compressed_blob_bls;
-  IOContext ioc(cct, NULL, true); // allow EIO
+  IOContext ioc(cct, NULL, !cct->_conf->bluestore_fail_eio);
   r = _prepare_read_ioc(blobs2read, &compressed_blob_bls, &ioc);
   // we always issue aio for reading, so errors other than EIO are not allowed
   if (r < 0)
@@ -10526,7 +10526,7 @@ int BlueStore::_do_readv(
     cct->_conf->bluestore_log_op_age);
   _dump_onode<30>(cct, *o);
 
-  IOContext ioc(cct, NULL, true); // allow EIO
+  IOContext ioc(cct, NULL, !cct->_conf->bluestore_fail_eio);
   vector<std::tuple<ready_regions_t, vector<bufferlist>, blobs2read_t>> raw_results;
   raw_results.reserve(m.num_intervals());
   int i = 0;