Skip to content

Commit 169c8a5

Browse files
Fix a typo in Week2 Day3 (#129)
1 parent 63c048f commit 169c8a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mini-lsm-book/src/week2-03-tiered.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ The first trigger of universal compaction is by space amplification ratio. As we
4848

4949
The reason why we compute the space amplification ratio like this is because we model the engine in a way that it stores a fixed amount of user data (i.e., assume it's 100GB), and the user keeps updating the values by writing to the engine. Therefore, eventually, all keys get pushed down to the bottom-most tier, the bottom-most tier size should be equivalent to the amount of data (100GB), the upper tiers contain updates to the data that are not yet compacted to the bottom-most tier.
5050

51-
When `all levels except last level size / last level size` >= `max_size_amplification_percent * 100%`, we will need to trigger a full compaction. For example, if we have a LSM state like:
51+
When `all levels except last level size / last level size` >= `max_size_amplification_percent * 1%`, we will need to trigger a full compaction. For example, if we have a LSM state like:
5252

5353
```
5454
Tier 3: 1
5555
Tier 2: 1 ; all levels except last level size = 2
5656
Tier 1: 1 ; last level size = 1, 2/1=2
5757
```
5858

59-
Assume `max_size_amplification_percent` = 200%, we should trigger a full compaction now.
59+
Assume `max_size_amplification_percent` = 200, we should trigger a full compaction now.
6060

6161
After you implement this trigger, you can run the compaction simulator. You will see:
6262

@@ -151,7 +151,7 @@ The current trigger only reduces space amplification. We will need to add new tr
151151

152152
### Task 1.2: Triggered by Size Ratio
153153

154-
The next trigger is the size ratio trigger. The trigger maintains the size ratio between the tiers. From the first tier, we compute the size of `this tier / sum of all previous tiers`. For the first encountered tier where this value `> (100 + size_ratio) * 100%`, we will compact all previous tiers excluding the current tier. We only do this compaction with there are more than `min_merge_width` tiers to be merged.
154+
The next trigger is the size ratio trigger. The trigger maintains the size ratio between the tiers. From the first tier, we compute the size of `this tier / sum of all previous tiers`. For the first encountered tier where this value `> (100 + size_ratio) * 1%`, we will compact all previous tiers excluding the current tier. We only do this compaction with there are more than `min_merge_width` tiers to be merged.
155155

156156
For example, given the following LSM state, and assume size_ratio = 1, we should compact when the ratio value > 101%:
157157

0 commit comments

Comments
 (0)