OPTION(rocksdb_collect_compaction_stats, OPT_BOOL, false) //For rocksdb, this behavior will be an overhead of 5%~10%, collected only rocksdb_perf is enabled.
OPTION(rocksdb_collect_extended_stats, OPT_BOOL, false) //For rocksdb, this behavior will be an overhead of 5%~10%, collected only rocksdb_perf is enabled.
OPTION(rocksdb_collect_memory_stats, OPT_BOOL, false) //For rocksdb, this behavior will be an overhead of 5%~10%, collected only rocksdb_perf is enabled.
+OPTION(rocksdb_enable_rmrange, OPT_BOOL, false) // see https://github.com/facebook/rocksdb/blob/master/include/rocksdb/db.h#L253
// rocksdb options that will be used for omap(if omap_backend is rocksdb)
OPTION(filestore_rocksdb_options, OPT_STR, "")
const string &start,
const string &end)
{
- bat.DeleteRange(combine_strings(prefix, start), combine_strings(prefix, end));
+ if (db->enable_rmrange) {
+ bat.DeleteRange(combine_strings(prefix, start), combine_strings(prefix, end));
+ } else {
+ auto it = db->get_iterator(prefix);
+ it->lower_bound(start);
+ while (it->valid()) {
+ if (it->key() >= end) {
+ break;
+ }
+ bat.Delete(combine_strings(prefix, it->key()));
+ it->next();
+ }
+ }
}
void RocksDBStore::RocksDBTransactionImpl::merge(
/// compact the underlying rocksdb store
bool compact_on_mount;
bool disableWAL;
+ bool enable_rmrange;
void compact() override;
int tryInterpret(const string key, const string val, rocksdb::Options &opt);
compact_queue_stop(false),
compact_thread(this),
compact_on_mount(false),
- disableWAL(false)
+ disableWAL(false),
+ enable_rmrange(cct->_conf->rocksdb_enable_rmrange)
{}
~RocksDBStore() override;