flags:
- create
with_legacy: true
+- name: bluestore_elastic_shared_blobs
+ type: bool
+ level: advanced
+ desc: Let bluestore to reuse existing shared blobs if possible
+ long_desc: Overwrites on snapped objects cause shared blob count to grow.
+ It has a very negative performance effect. When enabled shared blob count
+ is significantly reduced.
+ default: false
+ flags:
+ - create
+ with_legacy: false
- name: bluestore_allocator
type: str
level: advanced
return 0;
}
+
+// Reads configuration.
+// Validates values.
+//
+// In future this should be the only place that reads meta,
+// except initialization of components, like BlueFS, FreeListManager
+//
+// NOTE: Any configuration settings that affect data layout on disk
+// must be persisted to meta.
+int BlueStore::read_meta_conf_check_env()
+{
+ int r = 0;
+ std::string esb;
+ r = read_meta("elastic_shared_blobs",&esb);
+ if (r == 0) {
+ if (esb != "1" && esb != "0") {
+ derr << __func__ << " wrong meta.elastic_shared_blobs=" << esb << dendl;
+ r = -EIO;
+ } else {
+ elastic_shared_blobs = esb == "1";
+ }
+ } else {
+ if (r == -ENOENT) {
+ dout(1) << __func__ << " meta.elastic_shared_blobs not set, using legacy mode" << dendl;
+ elastic_shared_blobs = false;
+ r = 0;
+ }
+ }
+ return r;
+}
+
+
void BlueStore::_init_logger()
{
PerfCountersBuilder b(cct, "bluestore",
if (r < 0)
goto out_close_fm;
+ r = write_meta("elastic_shared_blobs",
+ cct->_conf.get_val<bool>("bluestore_elastic_shared_blobs") ? "1" : "0");
+ if (r < 0)
+ goto out_close_fm;
+
if (fsid != old_fsid) {
r = _write_fsid();
if (r < 0) {
int BlueStore::_mount()
{
- dout(5) << __func__ << "NCB:: path " << path << dendl;
+ dout(5) << __func__ << " path " << path << dendl;
+
+ {
+ int r = read_meta_conf_check_env();
+ if (r < 0) {
+ return r;
+ }
+ }
_kv_only = false;
if (cct->_conf->bluestore_fsck_on_mount) {
- dout(5) << __func__ << "::NCB::calling fsck()" << dendl;
int rc = fsck(cct->_conf->bluestore_fsck_on_mount_deep);
if (rc < 0)
return rc;
static_assert(std::numeric_limits<uint8_t>::max() >
std::numeric_limits<decltype(min_alloc_size)>::digits,
"not enough bits for min_alloc_size");
+ bool elastic_shared_blobs = false; ///< use smart ExtentMap::dup to reduce shared blob count
// smr-only
uint64_t zone_size = 0; ///< number of SMR zones
int write_meta(const std::string& key, const std::string& value) override;
int read_meta(const std::string& key, std::string *value) override;
+ int read_meta_check(const std::string& key, std::string *value);
+
+ int read_meta_conf_check_env();
// open in read-only and limited mode
int cold_open();