Skip to content

Commit

Permalink
Add WARN/INFO for mempurge output status. (facebook#8514)
Browse files Browse the repository at this point in the history
Summary:
The MemPurge output status can either be an Abort if the mempurge is aborted due to the new_mem memtable reaching more than the target capacity (currently 60%), or for other reasons. As a result, in the log, we want to differentiate between an abort status, which in this PR only leads to a ROCKS_LOG_INFO, and any other status, which in this PR leads to a ROCKS_LOG_WARN.

Pull Request resolved: facebook#8514

Reviewed By: pdillinger

Differential Revision: D29662446

Pulled By: bjlemaire

fbshipit-source-id: c9bec8e238ebc7ecb14fbbddf580e6887e281c16
  • Loading branch information
bjlemaire authored and facebook-github-bot committed Jul 12, 2021
1 parent 0b75b22 commit 955b80e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions db/flush_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,17 @@ Status FlushJob::Run(LogsWithPrepTracker* prep_tracker,
(!mems_.empty())) {
mempurge_s = MemPurge();
if (!mempurge_s.ok()) {
ROCKS_LOG_INFO(db_options_.info_log,
"Mempurge process unsuccessful: %s\n",
mempurge_s.ToString().c_str());
// Mempurge is typically aborted when the new_mem output memtable
// is filled at more than XX % capacity (currently: 60%).
if (mempurge_s.IsAborted()) {
ROCKS_LOG_INFO(db_options_.info_log, "Mempurge process aborted: %s\n",
mempurge_s.ToString().c_str());
} else {
// However the mempurge process can also fail for
// other reasons (eg: new_mem->Add() fails).
ROCKS_LOG_WARN(db_options_.info_log, "Mempurge process failed: %s\n",
mempurge_s.ToString().c_str());
}
}
}
Status s;
Expand Down

0 comments on commit 955b80e

Please sign in to comment.