From 63b0ab488b752ce8c8439e7904bd72c4b688bff0 Mon Sep 17 00:00:00 2001 From: Alwin Antreich Date: Thu, 6 Dec 2018 14:45:20 +0100 Subject: [PATCH] cherry-pick - os/bluestore: handle spurious read errors The patch retries the read if the checksum verification fails, usually seen on hosts under memory pressure. Signed-off-by: Alwin Antreich --- ...luestore-handle-spurious-read-errors.patch | 270 ++++++++++++++++++ patches/series | 1 + 2 files changed, 271 insertions(+) create mode 100644 patches/0008-os-bluestore-handle-spurious-read-errors.patch diff --git a/patches/0008-os-bluestore-handle-spurious-read-errors.patch b/patches/0008-os-bluestore-handle-spurious-read-errors.patch new file mode 100644 index 000000000..6fe8d5985 --- /dev/null +++ b/patches/0008-os-bluestore-handle-spurious-read-errors.patch @@ -0,0 +1,270 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alwin Antreich +Date: Thu, 6 Dec 2018 12:14:04 +0100 +Subject: [PATCH] os/bluestore: handle spurious read errors + +Some kernels (4.9+) sometime fail to return data when reading +from a block device under memory pressure. This patch retries +the read if the checksum verification fails, tests show that +the first retried read succeeds in ~99.5% of the cases, so +3 attempts are made by default before giving up on the data. + +Works-around: http://tracker.ceph.com/issues/22464 +Signed-off-by: Paul Emmerich +(cherry picked from commit cffcbc73aaaa874829d5fc9091af3042b887f9a7) + + Conflicts: + src/common/legacy_config_opts.h +- adjacent options + src/common/options.cc +- no RUNTIME flag in luminous + src/os/bluestore/BlueStore.cc + src/os/bluestore/BlueStore.h +- adjacent perfcounter + src/test/objectstore/store_test.cc +- adjacent tests, no #ifdef +- g_conf, not g_conf() +- no create_new_collection +- queue_transaction etc take osr, not ch + +Signed-off-by: Alwin Antreich +--- + src/common/legacy_config_opts.h | 2 + + src/common/options.cc | 10 +++++ + src/os/bluestore/BlueStore.cc | 35 ++++++++++++++-- + src/os/bluestore/BlueStore.h | 4 +- + src/test/objectstore/store_test.cc | 67 ++++++++++++++++++++++++++++++ + 5 files changed, 114 insertions(+), 4 deletions(-) + +diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h +index a51870ef6..54d2b578b 100644 +--- a/src/common/legacy_config_opts.h ++++ b/src/common/legacy_config_opts.h +@@ -1031,6 +1031,7 @@ OPTION(bluestore_block_preallocate_file, OPT_BOOL) //whether preallocate space i + OPTION(bluestore_csum_type, OPT_STR) // none|xxhash32|xxhash64|crc32c|crc32c_16|crc32c_8 + OPTION(bluestore_csum_min_block, OPT_U32) + OPTION(bluestore_csum_max_block, OPT_U32) ++OPTION(bluestore_retry_disk_reads, OPT_U64) + OPTION(bluestore_min_alloc_size, OPT_U32) + OPTION(bluestore_min_alloc_size_hdd, OPT_U32) + OPTION(bluestore_min_alloc_size_ssd, OPT_U32) +@@ -1124,6 +1125,7 @@ OPTION(bluestore_debug_omit_kv_commit, OPT_BOOL) + OPTION(bluestore_debug_permit_any_bdev_label, OPT_BOOL) + OPTION(bluestore_shard_finishers, OPT_BOOL) + OPTION(bluestore_debug_random_read_err, OPT_DOUBLE) ++OPTION(bluestore_debug_inject_csum_err_probability, OPT_FLOAT) + + OPTION(kstore_max_ops, OPT_U64) + OPTION(kstore_max_bytes, OPT_U64) +diff --git a/src/common/options.cc b/src/common/options.cc +index ff3bb1a1b..8983210d9 100644 +--- a/src/common/options.cc ++++ b/src/common/options.cc +@@ -3422,6 +3422,12 @@ std::vector