From 7b9db9c98e9a4f7eb923dbf283a6fd571148de7d Mon Sep 17 00:00:00 2001 From: Abhishek Kona Date: Mon, 18 Mar 2013 12:04:38 -0700 Subject: [PATCH] DO not report level size as zero when there are no files in L0 Summary: Instead of checking for number of files in L0. Check for number of files in the requested level. Bug introduced in D4929 (diff trying to do too many things). Test Plan: db_test. Reviewers: dhruba, MarkCallaghan Reviewed By: dhruba Differential Revision: https://reviews.facebook.net/D9483 --- db/version_set.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/db/version_set.cc b/db/version_set.cc index 23a5b05f6..f15ff9c33 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -1657,10 +1657,8 @@ void VersionSet::AddLiveFilesCurrentVersion(std::set* live) { int64_t VersionSet::NumLevelBytes(int level) const { assert(level >= 0); assert(level < NumberLevels()); - if(current_ && level < (int)current_->files_->size()) - return TotalFileSize(current_->files_[level]); - else - return 0; + assert(current_); + return TotalFileSize(current_->files_[level]); } int64_t VersionSet::MaxNextLevelOverlappingBytes() {