]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add bluestore_ignore_data_csum option 26233/head
authorSage Weil <sage@redhat.com>
Thu, 31 Jan 2019 23:33:57 +0000 (17:33 -0600)
committerSage Weil <sage@redhat.com>
Thu, 31 Jan 2019 23:33:57 +0000 (17:33 -0600)
This option just suppresses the EIO errors.  We still get the messages
in the logs, though.  This can be useful when you are in dire straights
and prefer some data to no data.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/os/bluestore/BlueStore.cc

index a71d2dac51a3651e9eddfc99ddb30487e723c514..3d456cc7741e471cb1b60b8ae51dd039a186bb4d 100644 (file)
@@ -970,6 +970,7 @@ OPTION(bluestore_block_wal_path, OPT_STR)
 OPTION(bluestore_block_wal_size, OPT_U64) // rocksdb wal
 OPTION(bluestore_block_wal_create, OPT_BOOL)
 OPTION(bluestore_block_preallocate_file, OPT_BOOL) //whether preallocate space if block/db_path/wal_path is file rather that block device.
+OPTION(bluestore_ignore_data_csum, OPT_BOOL)
 OPTION(bluestore_csum_type, OPT_STR) // none|xxhash32|xxhash64|crc32c|crc32c_16|crc32c_8
 OPTION(bluestore_retry_disk_reads, OPT_U64)
 OPTION(bluestore_min_alloc_size, OPT_U32)
index 245cac9af8f122ac2a434375466cc8b597b9bcb1..d3d437fda6a872b6364f186f396930a992403d36 100644 (file)
@@ -4202,6 +4202,11 @@ std::vector<Option> get_global_options() {
     .set_flag(Option::FLAG_CREATE)
     .set_description("Preallocate file created via bluestore_block*_create"),
 
+    Option("bluestore_ignore_data_csum", Option::TYPE_BOOL, Option::LEVEL_DEV)
+    .set_default(false)
+    .set_flag(Option::FLAG_RUNTIME)
+    .set_description("Ignore checksum errors on read and do not generate an EIO error"),
+
     Option("bluestore_csum_type", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("crc32c")
     .set_enum_allowed({"none", "crc32c", "crc32c_16", "crc32c_8", "xxhash32", "xxhash64"})
index f52b4868979bcc3840e8290295d2a74b0b2f40c5..e4de32e6fd119a43a8a8fb35b4e5e6adddd542a1 100644 (file)
@@ -8678,6 +8678,9 @@ int BlueStore::_verify_csum(OnodeRef& o,
     }
   }
   logger->tinc(l_bluestore_csum_lat, mono_clock::now() - start);
+  if (cct->_conf->bluestore_ignore_data_csum) {
+    return 0;
+  }
   return r;
 }