@@ -83,6 +83,7 @@ Status RedisZSets::Open(const StorageOptions& storage_options, const std::string
8383 column_families.emplace_back (rocksdb::kDefaultColumnFamilyName , meta_cf_ops);
8484 column_families.emplace_back (" data_cf" , data_cf_ops);
8585 column_families.emplace_back (" score_cf" , score_cf_ops);
86+ share_block_cache_ = storage_options.share_block_cache ;
8687 return rocksdb::DB::Open (db_ops, db_path, column_families, &handles_, &db_);
8788}
8889
@@ -101,6 +102,16 @@ Status RedisZSets::GetProperty(const std::string& property, uint64_t* out) {
101102 std::string value;
102103 db_->GetProperty (handles_[0 ], property, &value);
103104 *out = std::strtoull (value.c_str (), nullptr , 10 );
105+
106+ // If share_block_cache is enabled, block cache related properties are shared among CFs,
107+ // so we only need to get the value from the first CF to avoid double counting.
108+ if (share_block_cache_ &&
109+ (property == " rocksdb.block-cache-usage" ||
110+ property == " rocksdb.block-cache-capacity" ||
111+ property == " rocksdb.block-cache-pinned-usage" )) {
112+ return Status::OK ();
113+ }
114+
104115 db_->GetProperty (handles_[1 ], property, &value);
105116 *out += std::strtoull (value.c_str (), nullptr , 10 );
106117 db_->GetProperty (handles_[2 ], property, &value);
0 commit comments