-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compaction to cut output file if it can avoid to overlap a grandparen…
…t file Summary: By cutting compaction output files in level N, sometimes, we can avoid one file in level N+1 from overlapping with files in level N. Consider following case. Level N-1: [1, 21] Level N: [3, 23] Level N+1 [2, 4] [11, 15] [22, 24] (each [] represents a file and each number represents a key in the file) If we compact the files in N-1 and N, before the commit, we'll generate one single file in Level N: [1, 3, 21, 23] However, this will overlap with all the three files on level N+1. With the commit, we will cut the file into two: [1, 3] [21, 23] so that, the file [11, 15] will not overlap with any file in level N. This will reduce some write amplification when compacting N => N + 1 Test Plan: Add test cases in compaction_job_test to cover this case. Also add a test case to make sure normal max_compaction_bytes limit is still satisfied.
- Loading branch information
Showing
3 changed files
with
136 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters