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
This commit is contained in:
Abhishek Kona 2013-03-18 12:04:38 -07:00
parent f04cc368f7
commit 7b9db9c98e

View File

@ -1657,10 +1657,8 @@ void VersionSet::AddLiveFilesCurrentVersion(std::set<uint64_t>* 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() {