.set_default("compression=kNoCompression,max_write_buffer_number=4,min_write_buffer_number_to_merge=1,recycle_log_file_num=4,write_buffer_size=268435456,writable_file_max_buffer_size=0,compaction_readahead_size=2097152")
.set_description("Rocksdb options"),
+ Option("bluestore_rocksdb_cf", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+ .set_default(false)
+ .set_description("Enable use of rocksdb column families for bluestore metadata"),
+
Option("bluestore_fsck_on_mount", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(false)
.set_description("Run fsck at mount"),
const string PREFIX_ALLOC_BITMAP = "b"; // (see BitmapFreelistManager)
const string PREFIX_SHARED_BLOB = "X"; // u64 offset -> shared_blob_t
+const std::vector<KeyValueDB::ColumnFamily> cfs = {
+ KeyValueDB::ColumnFamily(PREFIX_OMAP, ""),
+ KeyValueDB::ColumnFamily(PREFIX_DEFERRED, ""),
+};
+
// write a label in the first block. always use this size. note that
// bluefs makes a matching assumption about the location of its
// superblock (always the second block of the device).
if (kv_backend == "rocksdb")
options = cct->_conf->bluestore_rocksdb_options;
db->init(options);
- if (create)
- r = db->create_and_open(err);
- else
- r = db->open(err);
+ if (create) {
+ if (cct->_conf->get_val<bool>("bluestore_rocksdb_cf")) {
+ r = db->create_and_open(err, cfs);
+ } else {
+ r = db->create_and_open(err);
+ }
+ } else {
+ // we pass in cf list here, but it is only used if the db already has
+ // column families created.
+ r = db->open(err, cfs);
+ }
if (r) {
derr << __func__ << " erroring opening db: " << err.str() << dendl;
if (bluefs) {