From e95c5700479876e0a361e3999c2bab7c8eeb5430 Mon Sep 17 00:00:00 2001 From: Zaorang Yang Date: Fri, 6 Aug 2021 15:26:06 -0700 Subject: [PATCH] Fix the wrong comment of level compaction cf paths test (#8533) Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/8533 Reviewed By: ajkr Differential Revision: D29718067 fbshipit-source-id: b4b91c9271362e7a7d47ddbaf28f56fb537cc668 --- db/db_compaction_test.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/db/db_compaction_test.cc b/db/db_compaction_test.cc index 9c9c04f42..20b0a36b4 100644 --- a/db/db_compaction_test.cc +++ b/db/db_compaction_test.cc @@ -2332,7 +2332,7 @@ TEST_P(DBCompactionTestWithParam, LevelCompactionCFPathUse) { option_vector.emplace_back(DBOptions(options), cf_opt1); CreateColumnFamilies({"one"},option_vector[1]); - // Configura CF2 specific paths. + // Configure CF2 specific paths. cf_opt2.cf_paths.emplace_back(dbname_ + "cf2", 500 * 1024); cf_opt2.cf_paths.emplace_back(dbname_ + "cf2_2", 4 * 1024 * 1024); cf_opt2.cf_paths.emplace_back(dbname_ + "cf2_3", 1024 * 1024 * 1024); @@ -2387,13 +2387,16 @@ TEST_P(DBCompactionTestWithParam, LevelCompactionCFPathUse) { // Check that default column family uses db_paths. // And Column family "one" uses cf_paths. - // First three 110KB files are not going to second path. - // After that, (100K, 200K) + // The compaction in level0 outputs the sst files in level1. + // The first path cannot hold level1's data(400KB+400KB > 500KB), + // so every compaction move a sst file to second path. Please + // refer to LevelCompactionBuilder::GetPathId. for (int num = 0; num < 3; num++) { generate_file(); } + check_sstfilecount(0, 1); + check_sstfilecount(1, 2); - // Another 110KB triggers a compaction to 400K file to fill up first path generate_file(); check_sstfilecount(1, 3);