From 955b80e84f7f17d7242e526acebac8c411fc2f33 Mon Sep 17 00:00:00 2001 From: bjlemaire <31483855+bjlemaire@users.noreply.github.com> Date: Mon, 12 Jul 2021 10:41:28 -0700 Subject: [PATCH] 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 --- db/flush_job.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/db/flush_job.cc b/db/flush_job.cc index 2cc306fbd..b58cca864 100644 --- a/db/flush_job.cc +++ b/db/flush_job.cc @@ -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; -- GitLab