Skip to content

Commit

Permalink
rocksdb: build with rocksdb-7.y.z
Browse files Browse the repository at this point in the history
RocksDB 7, specifically 7.2.2 has landed in Fedora 37/rawhide.

https://tracker.ceph.com/issues/55730

Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
  • Loading branch information
kalebskeithley authored and tchaikov committed May 24, 2022
1 parent f0aeb2e commit eea1028
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/kv/RocksDBStore.cc
Expand Up @@ -1385,24 +1385,21 @@ int64_t RocksDBStore::estimate_prefix_size(const string& prefix,
const string& key_prefix)
{
uint64_t size = 0;
uint8_t flags =
//rocksdb::DB::INCLUDE_MEMTABLES | // do not include memtables...
rocksdb::DB::INCLUDE_FILES;
auto p_iter = cf_handles.find(prefix);
if (p_iter != cf_handles.end()) {
for (auto cf : p_iter->second.handles) {
uint64_t s = 0;
string start = key_prefix + string(1, '\x00');
string limit = key_prefix + string("\xff\xff\xff\xff");
rocksdb::Range r(start, limit);
db->GetApproximateSizes(cf, &r, 1, &s, flags);
db->GetApproximateSizes(cf, &r, 1, &s);
size += s;
}
} else {
string start = combine_strings(prefix , key_prefix);
string limit = combine_strings(prefix , key_prefix + "\xff\xff\xff\xff");
rocksdb::Range r(start, limit);
db->GetApproximateSizes(default_cf, &r, 1, &size, flags);
db->GetApproximateSizes(default_cf, &r, 1, &size);
}
return size;
}
Expand Down
2 changes: 1 addition & 1 deletion src/kv/rocksdb_cache/BinnedLRUCache.cc
Expand Up @@ -570,7 +570,7 @@ void BinnedLRUCache::DisownData() {
#endif // !__SANITIZE_ADDRESS__
}

#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
#if (ROCKSDB_MAJOR >= 7 || (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR >= 22))
DeleterFn BinnedLRUCache::GetDeleter(Handle* handle) const
{
return reinterpret_cast<const BinnedLRUHandle*>(handle)->deleter;
Expand Down
2 changes: 1 addition & 1 deletion src/kv/rocksdb_cache/BinnedLRUCache.h
Expand Up @@ -327,7 +327,7 @@ class BinnedLRUCache : public ShardedCache {
virtual size_t GetCharge(Handle* handle) const override;
virtual uint32_t GetHash(Handle* handle) const override;
virtual void DisownData() override;
#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
#if (ROCKSDB_MAJOR >= 7 || (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR >= 22))
virtual DeleterFn GetDeleter(Handle* handle) const override;
#endif
// Retrieves number of elements in LRU, for unit test purpose only
Expand Down
2 changes: 1 addition & 1 deletion src/kv/rocksdb_cache/ShardedCache.cc
Expand Up @@ -109,7 +109,7 @@ size_t ShardedCache::GetPinnedUsage() const {
return usage;
}

#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
#if (ROCKSDB_MAJOR >= 7 || (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR >= 22))
DeleterFn ShardedCache::GetDeleter(Handle* handle) const
{
uint32_t hash = GetHash(handle);
Expand Down
4 changes: 2 additions & 2 deletions src/kv/rocksdb_cache/ShardedCache.h
Expand Up @@ -83,11 +83,11 @@ class ShardedCache : public rocksdb::Cache, public PriorityCache::PriCache {
virtual size_t GetUsage(rocksdb::Cache::Handle* handle) const override;
virtual size_t GetPinnedUsage() const override;
virtual size_t GetCharge(Handle* handle) const = 0;
#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
#if (ROCKSDB_MAJOR >= 7 || (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR >= 22))
virtual DeleterFn GetDeleter(Handle* handle) const override;
#endif
virtual void DisownData() override = 0;
#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
#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,
Expand Down

0 comments on commit eea1028

Please sign in to comment.