Add dump all keys for cache dumper impl (#12500)

Summary:
Fixes https://github.com/facebook/rocksdb/issues/12501

Pull Request resolved: https://github.com/facebook/rocksdb/pull/12500

Reviewed By: jowlyzhang

Differential Revision: D55922379

Pulled By: ajkr

fbshipit-source-id: 0759afcec148d256a2d1cd5ef76fd988fab4a9af
This commit is contained in:
liuhu
2024-04-12 10:47:13 -07:00
committed by Facebook GitHub Bot
parent b166ca8b74
commit 6fbd02f258
3 changed files with 5 additions and 1 deletions
@@ -0,0 +1 @@
Dump all keys for cache dumper impl if `SetDumpFilter()` is not called
+2 -1
View File
@@ -26,6 +26,7 @@ namespace ROCKSDB_NAMESPACE {
// requirement.
Status CacheDumperImpl::SetDumpFilter(std::vector<DB*> db_list) {
Status s = Status::OK();
dump_all_keys_ = false;
for (size_t i = 0; i < db_list.size(); i++) {
assert(i < db_list.size());
TablePropertiesCollection ptc;
@@ -157,7 +158,7 @@ CacheDumperImpl::DumpOneBlockCallBack(std::string& buf) {
}
// based on the key prefix, check if the block should be filter out.
if (ShouldFilterOut(key)) {
if (!dump_all_keys_ && ShouldFilterOut(key)) {
return;
}
+2
View File
@@ -126,6 +126,8 @@ class CacheDumperImpl : public CacheDumper {
// Deadline for dumper in microseconds.
std::chrono::microseconds deadline_;
uint64_t dumped_size_bytes_;
// dump all keys of cache if user doesn't call SetDumpFilter
bool dump_all_keys_ = true;
};
// The default implementation of CacheDumpedLoader