From: haoyixing Date: Sat, 18 Sep 2021 09:48:12 +0000 (+0800) Subject: os/bluestore: add option for bluestore fail eio X-Git-Tag: v17.1.0~731^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=60409d2bc4d1d54513ca55a9bab6ab299f15e57c;p=ceph-ci.git os/bluestore: add option for bluestore fail eio 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 --- diff --git a/src/common/options/global.yaml.in b/src/common/options/global.yaml.in index 09a2fdd02b4..f65493199ed 100644 --- a/src/common/options/global.yaml.in +++ b/src/common/options/global.yaml.in @@ -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 diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e8fb4fe3739..e1839ba1884 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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 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, blobs2read_t>> raw_results; raw_results.reserve(m.num_intervals()); int i = 0;