Add WARN/INFO for mempurge output status. (#8514)

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: https://github.com/facebook/rocksdb/pull/8514

Reviewed By: pdillinger

Differential Revision: D29662446

Pulled By: bjlemaire

fbshipit-source-id: c9bec8e238ebc7ecb14fbbddf580e6887e281c16
main
bjlemaire 4 years ago committed by Facebook GitHub Bot
parent 0b75b22321
commit 955b80e84f
  1. 14
      db/flush_job.cc

@ -233,9 +233,17 @@ Status FlushJob::Run(LogsWithPrepTracker* prep_tracker,
(!mems_.empty())) { (!mems_.empty())) {
mempurge_s = MemPurge(); mempurge_s = MemPurge();
if (!mempurge_s.ok()) { if (!mempurge_s.ok()) {
ROCKS_LOG_INFO(db_options_.info_log, // Mempurge is typically aborted when the new_mem output memtable
"Mempurge process unsuccessful: %s\n", // is filled at more than XX % capacity (currently: 60%).
mempurge_s.ToString().c_str()); 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; Status s;

Loading…
Cancel
Save