From ca209949be3151168ecf9a3699920b140db58e3e Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Fri, 23 Dec 2016 00:06:50 +0800 Subject: [PATCH 1/2] os/bluestore/bluefs: make bluefs_preextend_wal_files default is false. This make rocksdb log corruption. Before fix, disable this function. Signed-off-by: Jianpeng Ma --- src/common/config_opts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 169b05d872056..8edeed6dd02a8 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -984,7 +984,7 @@ OPTION(bluefs_min_flush_size, OPT_U64, 65536) // ignore flush until its this bi OPTION(bluefs_compact_log_sync, OPT_BOOL, false) // sync or async log compaction? OPTION(bluefs_buffered_io, OPT_BOOL, false) OPTION(bluefs_allocator, OPT_STR, "bitmap") // stupid | bitmap -OPTION(bluefs_preextend_wal_files, OPT_BOOL, true) // this *requires* that rocksdb has recycling enabled +OPTION(bluefs_preextend_wal_files, OPT_BOOL, false) // this *requires* that rocksdb has recycling enabled OPTION(bluestore_bluefs, OPT_BOOL, true) OPTION(bluestore_bluefs_env_mirror, OPT_BOOL, false) // mirror to normal Env for debug From 05a10d84ecc38dcebc833f223eae19c303d45a7f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 22 Dec 2016 11:03:51 -0500 Subject: [PATCH 2/2] os/bluestore: remove 'extents' from shard_info We don't use this field; no need to consume the space on disk. Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 1 - src/os/bluestore/bluestore_types.cc | 5 ++--- src/os/bluestore/bluestore_types.h | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index a97205010223c..2ca7882085dbd 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1661,7 +1661,6 @@ bool BlueStore::ExtentMap::update(Onode *o, KeyValueDB::Transaction t, } assert(p->shard_info->offset == p->offset); p->shard_info->bytes = len; - p->shard_info->extents = nn; t->set(PREFIX_OBJ, p->key, bl); p->dirty = false; } diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index 01630cbc1df87..36bcedbfd7fb6 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -546,13 +546,12 @@ void bluestore_onode_t::shard_info::dump(Formatter *f) const { f->dump_unsigned("offset", offset); f->dump_unsigned("bytes", bytes); - f->dump_unsigned("extents", extents); } ostream& operator<<(ostream& out, const bluestore_onode_t::shard_info& si) { - return out << std::hex << "0x" << si.offset << "(0x" << si.bytes << " bytes, " - << std::dec << si.extents << " extents)"; + return out << std::hex << "0x" << si.offset << "(0x" << si.bytes << " bytes" + << std::dec << ")"; } void bluestore_onode_t::dump(Formatter *f) const diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index 2e684791bf511..20cda85d05289 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -673,11 +673,9 @@ struct bluestore_onode_t { struct shard_info { uint32_t offset = 0; ///< logical offset for start of shard uint32_t bytes = 0; ///< encoded bytes - uint32_t extents = 0; ///< extents DENC(shard_info, v, p) { denc_varint(v.offset, p); denc_varint(v.bytes, p); - denc_varint(v.extents, p); } void dump(Formatter *f) const; };