From a91fdf1b998d9a2e5afb636b5b84712de47659d7 Mon Sep 17 00:00:00 2001 From: Dhruba Borthakur Date: Wed, 24 Jul 2013 14:20:54 -0700 Subject: [PATCH] The target file size for L0 files was incorrectly set to LLONG_MAX. Summary: The target file size should be valid value. Only if UniversalCompactionStyle is enabled then set max file size to be LLONG_MAX. Test Plan: Reviewers: CC: Task ID: # Blame Rev: --- db/version_set.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/version_set.cc b/db/version_set.cc index c8877fb82..79965c962 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -1039,8 +1039,8 @@ void VersionSet::Init(int num_levels) { int target_file_size_multiplier = options_->target_file_size_multiplier; int max_bytes_multiplier = options_->max_bytes_for_level_multiplier; for (int i = 0; i < num_levels; i++) { - if (i == 0) { - max_file_size_[i] = LLONG_MAX; + if (i == 0 && options_->compaction_style == kCompactionStyleUniversal) { + max_file_size_[i] = ULLONG_MAX; level_max_bytes_[i] = options_->max_bytes_for_level_base; } else if (i > 1) { max_file_size_[i] = max_file_size_[i-1] * target_file_size_multiplier;