From 6723ba07fda8174cc4d10576358eac75f79e40a3 Mon Sep 17 00:00:00 2001 From: Alex Chi Z Date: Mon, 29 Jan 2024 23:34:56 +0800 Subject: [PATCH] Update week1-01-memtable.md --- mini-lsm-book/src/week1-01-memtable.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mini-lsm-book/src/week1-01-memtable.md b/mini-lsm-book/src/week1-01-memtable.md index c24be38..983d224 100644 --- a/mini-lsm-book/src/week1-01-memtable.md +++ b/mini-lsm-book/src/week1-01-memtable.md @@ -65,7 +65,7 @@ src/mem_table.rs ![one memtable LSM](./lsm-tutorial/week1-01-frozen.svg) -A memtable cannot continuously grow in size, and we will need to freeze them (and later flush to the disk) when it reaches the size limit. You may find the memtable size limit, which is equal to the SST size limit, in the `LsmStorageOptions`. This is not a hard limit and you should freeze the memtable at best effort. +A memtable cannot continuously grow in size, and we will need to freeze them (and later flush to the disk) when it reaches the size limit. You may find the memtable size limit, which is **equal to the SST size limit** (not `num_memtables_limit`), in the `LsmStorageOptions`. This is not a hard limit and you should freeze the memtable at best effort. In this task, you will need to compute the approximate memtable size when put/delete a key in the memtable. This can be computed by simply adding the total number of bytes of keys and values when `put` is called. Is a key is put twice, though the skiplist only contains the latest value, you may count it twice in the approximate memtable size. Once a memtable reaches the limit, you should call `force_freeze_memtable` to freeze the memtable and create a new one.