diff --git a/db/db_test.cc b/db/db_test.cc index e5d90f19b..17b480e4a 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -591,6 +591,7 @@ TEST(DBTest, LevelLimitReopen) { } options.num_levels = 1; + options.max_bytes_for_level_multiplier_additional.resize(1, 1); Status s = TryReopen(&options); ASSERT_EQ(s.IsCorruption(), true); ASSERT_EQ(s.ToString(), @@ -598,6 +599,7 @@ TEST(DBTest, LevelLimitReopen) { "more levels than options.num_levels"); options.num_levels = 10; + options.max_bytes_for_level_multiplier_additional.resize(10, 1); ASSERT_OK(TryReopen(&options)); } diff --git a/util/ldb_cmd.cc b/util/ldb_cmd.cc index 46dc7edc2..9b96d0e09 100644 --- a/util/ldb_cmd.cc +++ b/util/ldb_cmd.cc @@ -681,6 +681,7 @@ void ReduceDBLevelsCommand::Help(string& ret) { Options ReduceDBLevelsCommand::PrepareOptionsForOpenDB() { Options opt = LDBCommand::PrepareOptionsForOpenDB(); opt.num_levels = old_levels_; + opt.max_bytes_for_level_multiplier_additional.resize(opt.num_levels, 1); // Disable size compaction opt.max_bytes_for_level_base = 1UL << 50; opt.max_bytes_for_level_multiplier = 1;