ceph/0027-src-kv-rocksdb_cache-ShardedCache.h.patch
Kaleb S. KEITHLEY 3d4788fc3e patch0027
2023-04-20 13:56:14 -04:00

92 lines
4.3 KiB
Diff

--- ceph-17.2.6/src/kv/rocksdb_cache/ShardedCache.h.orig 2023-04-20 10:53:44.854094016 -0400
+++ ceph-17.2.6/src/kv/rocksdb_cache/ShardedCache.h 2023-04-20 11:39:12.847646205 -0400
@@ -15,7 +15,7 @@
#include <mutex>
#include "rocksdb/version.h"
-#include "rocksdb/cache.h"
+#include "rocksdb/advanced_cache.h"
#include "include/ceph_hash.h"
#include "common/PriorityCache.h"
//#include "hash.h"
@@ -68,8 +68,8 @@
virtual const char* Name() const override = 0;
virtual rocksdb::Status Insert(const rocksdb::Slice& key, void* value, size_t charge,
DeleterFn,
- rocksdb::Cache::Handle** handle, Priority priority) override;
- virtual rocksdb::Cache::Handle* Lookup(const rocksdb::Slice& key, rocksdb::Statistics* stats) override;
+ rocksdb::Cache::Handle** handle, Priority priority);
+ virtual rocksdb::Cache::Handle* Lookup(const rocksdb::Slice& key, rocksdb::Statistics* stats);
virtual bool Ref(rocksdb::Cache::Handle* handle) override;
virtual bool Release(rocksdb::Cache::Handle* handle, bool force_erase = false) override;
virtual void* Value(Handle* handle) override = 0;
@@ -84,14 +84,14 @@
virtual size_t GetPinnedUsage() const override;
virtual size_t GetCharge(Handle* handle) const = 0;
#if (ROCKSDB_MAJOR >= 7 || (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR >= 22))
- virtual DeleterFn GetDeleter(Handle* handle) const override;
+ virtual DeleterFn GetDeleter(Handle* handle) const;
#endif
virtual void DisownData() override = 0;
#if (ROCKSDB_MAJOR >= 7 || (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR >= 22))
virtual void ApplyToAllEntries(
const std::function<void(const rocksdb::Slice& key, void* value, size_t charge,
DeleterFn deleter)>& callback,
- const ApplyToAllEntriesOptions& opts) override;
+ const ApplyToAllEntriesOptions& opts);
#else
virtual void ApplyToAllCacheEntries(void (*callback)(void*, size_t),
bool thread_safe) override;
--- ceph-17.2.6/src/kv/RocksDBStore.cc.orig 2023-04-20 13:27:30.331781763 -0400
+++ ceph-17.2.6/src/kv/RocksDBStore.cc 2023-04-20 13:54:20.742215113 -0400
@@ -903,6 +903,19 @@
// base_name - name of column without shard suffix: "-"+number
// options - additional options to apply
// cf_opt - column family options to update
+
+Status GetColumnFamilyOptionsFromMap(
+ const ColumnFamilyOptions& base_options,
+ const std::unordered_map<std::string, std::string>& opts_map,
+ ColumnFamilyOptions* new_options, bool input_strings_escaped,
+ bool ignore_unknown_options) {
+ ConfigOptions config_options;
+ config_options.ignore_unknown_options = ignore_unknown_options;
+ config_options.input_strings_escaped = input_strings_escaped;
+ return rocksdb::GetColumnFamilyOptionsFromMap(config_options, base_options, opts_map,
+ new_options);
+}
+
int RocksDBStore::update_column_family_options(const std::string& base_name,
const std::string& more_options,
rocksdb::ColumnFamilyOptions* cf_opt)
@@ -916,7 +929,7 @@
<< " options=" << more_options << dendl;
return r;
}
- status = rocksdb::GetColumnFamilyOptionsFromMap(*cf_opt, options_map, cf_opt);
+ status = GetColumnFamilyOptionsFromMap(*cf_opt, options_map, cf_opt, false);
if (!status.ok()) {
dout(5) << __func__ << " invalid column family optionsp; column family="
<< base_name << " options=" << more_options << dendl;
@@ -937,6 +950,20 @@
return 0;
}
+Status GetBlockBasedTableOptionsFromMap(
+ const BlockBasedTableOptions& table_options,
+ const std::unordered_map<std::string, std::string>& opts_map,
+ BlockBasedTableOptions* new_table_options, bool input_strings_escaped,
+ bool ignore_unknown_options) {
+ ConfigOptions config_options;
+ config_options.input_strings_escaped = input_strings_escaped;
+ config_options.ignore_unknown_options = ignore_unknown_options;
+ config_options.invoke_prepare_options = false;
+
+ return rocksdb::GetBlockBasedTableOptionsFromMap(config_options, table_options,
+ opts_map, new_table_options);
+}
+
int RocksDBStore::apply_block_cache_options(const std::string& column_name,
const std::string& block_cache_opt,
rocksdb::ColumnFamilyOptions* cf_opt)