Skip to content

Commit

Permalink
Fix the wrong comment of level compaction cf paths test (facebook#8533)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: facebook#8533

Reviewed By: ajkr

Differential Revision: D29718067

fbshipit-source-id: b4b91c9271362e7a7d47ddbaf28f56fb537cc668
  • Loading branch information
zaorangyang authored and facebook-github-bot committed Aug 6, 2021
1 parent 543a201 commit e95c570
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions db/db_compaction_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit e95c570

Please sign in to comment.