From 07aa4e0e35831a29a68e82747b271cca1d5058f6 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Mon, 5 Jan 2015 17:32:49 -0800 Subject: [PATCH] Fix compaction summary log for trivial move Summary: When trivial move commit is done, we log the summary of the input version instead of current. This is inconsistent with other log messages and confusing. Test Plan: compiles Reviewers: sdong Reviewed By: sdong Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D30939 --- db/db_impl.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index dfe66eeab..7350d5729 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -2163,11 +2163,12 @@ Status DBImpl::BackgroundCompaction(bool* madeProgress, JobContext* job_context, VersionStorageInfo::LevelSummaryStorage tmp; c->column_family_data()->internal_stats()->IncBytesMoved( c->level() + 1, f->fd.GetFileSize()); - LogToBuffer(log_buffer, "[%s] Moved #%" PRIu64 " to level-%d %" PRIu64 - " bytes %s: %s\n", - c->column_family_data()->GetName().c_str(), f->fd.GetNumber(), - c->level() + 1, f->fd.GetFileSize(), status.ToString().c_str(), - c->input_version()->storage_info()->LevelSummary(&tmp)); + LogToBuffer( + log_buffer, + "[%s] Moved #%" PRIu64 " to level-%d %" PRIu64 " bytes %s: %s\n", + c->column_family_data()->GetName().c_str(), f->fd.GetNumber(), + c->level() + 1, f->fd.GetFileSize(), status.ToString().c_str(), + c->column_family_data()->current()->storage_info()->LevelSummary(&tmp)); c->ReleaseCompactionFiles(status); *madeProgress = true; } else {