Skip to content

Commit

Permalink
BwDcompactExecFactory: Check GetApproximateSizes() return status
Browse files Browse the repository at this point in the history
  • Loading branch information
rockeet committed Sep 13, 2023
1 parent 01f4c12 commit fc67066
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bw_side_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1232,8 +1232,13 @@ struct BwDcompactExecFactory : CompactionExecutorFactory {
auto flags = DB::SizeApproximationFlags::INCLUDE_FILES
| DB::SizeApproximationFlags::INCLUDE_MEMTABLES;
uint64_t meta_size = 0;
uint64_t input_size = 0;
Status s = db->GetApproximateSizes(&rng, 1, &meta_size, flags); // default cf
size_t input_size = 0;
if (!s.ok()) { // should not fail in real world
auto log = c->immutable_options()->info_log;
ROCKS_LOG_WARN(log, "GetApproximateSizes() failed, db: %s, cf: %s",
db->GetName().c_str(), data_cfd->GetName().c_str());
}
for (auto& lev : *c->inputs()) {
for (auto& file : lev.files)
input_size += file->fd.file_size;
Expand Down

0 comments on commit fc67066

Please sign in to comment.